cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Cross reference (xref) output with Styler

anne.bovard
1-Newbie

Cross reference (xref) output with Styler

Dear all,

I'm trying to invoke different cross reference formatting based on an xref attribute in a FOSI-based stylesheet. For example,

I. See <xref outputclass="text"/">. should generate "See Topic Title."

The instructions are to add <_gte:CrossReference refAttr="href" xrefStyle="Text"/> after the element content. Text's format is <_sfe:CrossReferenceTitle/>)

My output is: "See Topic Title."

Myt 2nd requirement is...

II. See <xref outputclass="page"/">. should generate "See 12."

The instructions are to add <_gte:CrossReference refAttr="href" xrefStyle="Page"/> after the element content. Page's format is <_gte:PageNumberReference/>)

My output is: "See Topic Title12."

Regardless of what Cross Reference I select from the Cross Reference Dialog box, the title of the topic I'm referencing appears in my output. I've also tried to make my own new cross reference types with the same end result. Where can I edit to get rid of the gentext?

Thanks so much for your time and attention.

Best regards,

Anne


7 REPLIES 7

First thing I see is that you're testing for xrefStyle="Text" and
xrefStyle="Page", but your outputclass attribute values are "text" and
"page". Have you verified this isn't a case sensitivity issue? That is,
if you have "Page" in the attr test, you should have "Page" in the XML,
rather than "page".



Hope this helps.



-Jean K.


Hi Jean,

Thanks so much for your reply. No, that didn't help. I'm testing for lowercase 'page' and 'text' in my attribute test. I didn't show that in my example- apologies. My casing matches in both the xml and styler attribute test. I am successfully adding the page number, it just comes with the unwanted topic title.

Does it make since that this behavior is coming from the sfe_CrossReference?

Here is the FOSI for the xref:

<e-i-c gi="xref" occur="all">
<charlist inherit="1">
<indent inherit="0"/">
<savetext textid="aftertext"&lt;br"/>conrule='!<_sfe:BeforeOrAfterText xmlns:_sfe="http://www.arbortext.com/namespace/Styler/StylerFormattingElements" xmlns:_ufe="http://www.arbortext.com/namespace/Styler/UserFormattingElements" ><_sfe:CrossReference>!,#XREF(href,Text.xref),!!'
placemnt="after"/></charlist>
<att>
<specval attname="outputclass" attval="text"/">
<charsubset>
<savetext textid="aftertext"&lt;br"/>conrule='!<_sfe:BeforeOrAfterText xmlns:_sfe="http://www.arbortext.com/namespace/Styler/StylerFormattingElements" xmlns:_ufe="http://www.arbortext.com/namespace/Styler/UserFormattingElements" ><_sfe:CrossReference>!,#XREF(href,Text.xref),!!'
placemnt="after"/>
<savetext textid="beforetext" conrule="\\" placemnt="before"/">
<savetext textid="repeat_title.txt" conrule="\\"/">
<savetext textid="repeat_title_bottom.txt" conrule="\\"/"></charsubset>
</att>
<att>
<specval attname="outputclass" attval="page"/">
<charsubset>
<savetext textid="aftertext"&lt;br"/>conrule='!<_sfe:BeforeOrAfterText xmlns:_sfe="http://www.arbortext.com/namespace/Styler/StylerFormattingElements" xmlns:_ufe="http://www.arbortext.com/namespace/Styler/UserFormattingElements" ><_sfe:CrossReference>!,#XREF(href,Page.xref),!!'
placemnt="after"/>
<savetext textid="beforetext" conrule="\\" placemnt="before"/">
<savetext textid="repeat_title.txt" conrule="\\"/">
<savetext textid="repeat_title_bottom.txt" conrule="\\"/"></charsubset>
</att>
<att>
<charsubset>
<usetext source="aftertext" placemnt="after"></usetext>
</charsubset>
</att>
</e-i-c>

If I don't style the xref at all, the topic title still comes in. So maybe it has nothing to do with the sfe_CrossReference...

Thanks,
Anne

Try removing the savetext after the indent on the e-i-c charlist - the
one that is not in an attribute rule. That savetext is saving up the
#XREF(href,Text.xref) variable, which is then output even when
outputclass attval="page" - this is why your Text.xref value always
comes through in your xrefs - it's always there, regardless of the
condition.



Hope this helps.



-Jean






My initial thought was the same as Jean's, and it may work. However, in theory, the savetext to "aftertext" in the "page" attribute test should replace the contents of "aftertext" before it's used. That first savetext might be intended as a default for the case where the xref doesn't have an outputclass attribute or has some value other than "text" or "page".

That said, if Jean's suggestion doesn't work, you may need to look at the e-i-c for the element that is the target of the xref to see if it is populating the "Page.xref" variable correctly.

-Brandon 🙂

I did consider the fact that both things are saving to
textid="aftertext", and that there's no append to put Text.xref ahead of
Page.xref., but that seemed too obvious... I too would expect the
resolution of the second attr test to stick #XREF(href,Page.xref) in the
aftertext textid, but from the description, thus erasing the
#XREF(href,Text.xref) value, but it really does sound like there's some
kind of append going on, despite the code.

The combination of attribute resolution and multiple #XREF saves to
variables (which I assume you have declared as a TIV?) is combining just
enough FOSI stuff together that I expect the unexpected - in this case,
the mere presence of a value in Text.xref causing a wonky append to the
aftertext textid brought about via the #XREF(href,Text.xref) conrule. It
may be a long shot, but it's still a place to start. If this isn't it,
I would go see what's going on with the _sfe Styler e-i-c, and the
target e-i-c to see just where and when the Text.xref and Page.xref IDs
get populated.

Beyond these suggestions, I would actually have to play with code and
maybe look some stuff up... (what? You thought I had the entire Outspec
committed to memory?)

Hopefully, this will give you a couple more things to rule out, if not
get to the root of the problem.

-Jean

Actually, I thought it was Lynn Hales that had the entire Outspec
memorized. Sometimes I think Andy Esslinger does, too.

Thanks so much for your input and suggestions.

I've found that I need to put something in between the xref tags for the stylesheet to behave the way I want it to.

"See <xref outputclass="page"> </xref>." generates "See 12."

and

"See <xref outputclass="page"></xref>." generates "See Topic Title12."

This isn't what I would expect, but I'm happy to have a fix.

Thanks again to all.

Best,

Anne


Top Tags