[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [docbook-apps] xrefs to <title> elements don't work
Thanks Bob. Your suggested style sheet customization worked for our documents; the links work and the correct text is displayed for the xref. One thing that I noticed is that the page.citation dows not work for the titles, however. This isn’t a big deal for me because I just turn them off on title xrefs, but is there a way to get that template to work
with title xrefs the same way that they would for section xrefs? Right now they show up as “<title text> on page .“ Eric From: Bob Stayton [mailto:bobs@sagehill.net]
Hi Eric, Actually, creating an xref to a title used to work in the stylesheets. Currently it gets the generated text right, but the link is to the id of the title element, and
most title elements do not output an @id attribute, so the link fails. It seems this feature was broken some time ago when the xref templates were rewritten to support universal linking in DocBook 5. This customization of the template named 'simple.xlink' from fo/inline.xsl fixes the id problem. It only corrects the problem for @linkend references, not for @xlink:href
references used in universal linking, but it should suffice for your needs. Search for 'linkend.candidate' to see where I made the changes. <xsl:template name="simple.xlink"> <xsl:choose> <!-- Is it a local idref? --> <!-- Is it an olink ? --> <xsl:choose> <xsl:when test="$is.idref = 1"> <xsl:variable name="idref"> <xsl:variable name="targets" select="key('id',$idref)"/> <xsl:call-template name="check.id.unique"> <xsl:choose> <xsl:otherwise> <!-- otherwise it's a URI --> <xsl:when test="$linkend.candidate"> <xsl:variable name="target.id"> <xsl:variable name="targets" select="key('id',$target.id)"/> <xsl:call-template name="check.id.unique"> <xsl:choose> <xsl:otherwise> <xsl:otherwise> </xsl:stylesheet> Bob Stayton From:
Eric Nordlund Sent: Thursday, April 04, 2013 6:00 PM Subject: [docbook-apps] xrefs to <title> elements don't work My company has a hundred or so books that were authored with Arbortext’s graphic XML editor. I’m having a problem processing these books with XSL-FO because so many of the xrefs in these books are to title elements instead of the parent
procedure, section, example, table, etc., elements. Is there a way to make these work in the XSL-FO output? I was thinking I could have a template that could recognize when an xref/@linkend pointed to the id of a title and then change the linkend to the id of the title’s parent element,
but I don’t really know how to do that. Is there another way to do what I need to do? Eric Nordlund Customer Documentation and Training Cray Inc. 901 5th Ave Seattle, WA 98164 (206)701-2232 |
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]