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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

<_sfe:InternalLink> samples please

apco
1-Newbie

<_sfe:InternalLink> samples please

Hi,

I am trying to build some internal links or cross references.

I have been trying to find a solution to my issues with links... and was hoping you could provide a working example of use of _sfe:InternalLink. I have been trying to get it working with no luck. The target id is not found. What are the rules on what a target can be?

I have tried linking to >

<sbdata targetid="8396-27-01">  *(though this targetid is not actually in the dtd so running composition with context checking off, sbdata is a formal block, and I inserted a title _ufe into sbdata beforetext)

<sbnbr>     8396-27-001, 0</sbnbr>

<sbtitle>xxx </sbtitle>

<mdnbr>800</mdnbr>

<issdate>MAY 30/95</issdate>

<hotlink targetid="8396-27-01" targetrefid="8396-27-01"></sbdata>

Using>

<_sfe:InternalLink><_gte:LinkTarget targetXPath="string('8396-27-001')"

targetAttrName="targetId">8396-27-001</_gte:LinkTarget><_gte:LinkContent

>8396-27-001</_gte:LinkContent></_sfe:InternalLink>

Thanks in advance,

Tracey

3 REPLIES 3
ClayHelberg
17-Peridot
(To:apco)

Hi Tracey--

I think you have the right idea, but it looks like you have an extra zero in your ID value in the gentext sample. Your targetid on <sbdata> is 8396-27-01, but in the gentext is appears as 8396-27-001. Does it work if you modify these so they match exactly?


--Clay

Hello Clay,

Thankyou for your response. Excuse my error. Unfortunately that is not the problem. I fixed the typo (and the lower case i) and it still does not work. I am actually trying to populate the linkTarget and linkContent by pulling in Element content , however that is not working either.

My problem is that I have element content ie. <chgnbr>8396-27-001</chgnbr> that needs to link to other element content within the one document <sbnbr>     8396-27-001, 0</sbnbr>.

I have tried inserting an intref element which is styled as a cross reference, and adding a _ufe title onto the sbdata, this almost works but I cannot get it to display anything other than the page number. I need the 8396-27-001 to be a clickable link.

I was hoping the <_sfe:InternalLink> might provide a simple solution but it appears not.

If anyone has any suggestions, they would be appreciated.

Thanks,

Tracey

ClayHelberg
17-Peridot
(To:apco)

Hi Tracey--

Xrefs in Styler are based on assumptions that the ID and IDREF are going to be attributes, not child (or descendant) elements. So, in order to make this work, you'll need to use gentext to create attribute-based link targets.

I would try an approach like this: in your <sbdata> element in Styler, add gentext to insert a link target before. This could be any DTD element styled as "Link Target" in Styler, for example the <anchor> element in Docbook. Use the Attribute Modifier in gentext to set the ID on the link target to the substring derived from <sbnbr>, probably using an XPath string, something like this:

<linktarget/>

     <_gte:AttributeModifier setAttrName="id" attrValueXPath="substring-before(./sbnbr, ',')">

          <_gte:XPathString expr="substring-before(./sbnbr, ',')"/>

     </_gte:AttributeModifier>

(In this example we assume the link target element is called <linktarget>.)

Then you can just set your link in the usual way, and it should work.

<_sfe:InternalLink>

     <_gte:LinkTarget targetXPath="string('8396-27-001')" targetAttrName="targetId">8396-27-001</_gte:LinkTarget>

     <_gte:LinkContent>8396-27-001</_gte:LinkContent>

</_sfe:InternalLink>

--Clay

Top Tags