[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: error testing id() in external document
At 2007-10-20 05:56 +1300, Trevor Nicholls wrote:
Using xsltproc (libxml), and thus inside an <xsl:stylesheet version="1.0">, Note version="1.0" the following template generates an error: In version 1.0 the id() function can only be the first step of a location path ... it cannot be otherwise. <xsl:message terminate="yes"> <xsl:text>Footnote reference to external document (</xsl:text> <xsl:value-of select="@srcfile" /> <xsl:text> found in </xsl:text> <xsl:value-of select="$myfullself" /> </xsl:message> </xsl:if> </xsl:template> Set the context one step at a time: <xsl:template match="jump[@srcfile]"> <xsl:variable name="jfil" select="substring-before(@srcfile,'#')" /> <xsl:variable name="jid" select="substring-after(@srcfile,'#')" /> <xsl:variable name="srcfile" select="@srcfile"/> <!-- footnotes are an invalid external reference --> <xsl:for-each select="document($jfil,/)"> <xsl:if test="local-name(id($jid)) = 'footnote'"> <xsl:message terminate="yes"> <xsl:text>Footnote reference to external document (</xsl:text> <xsl:value-of select="$srcfile" /> <xsl:text> found in </xsl:text> <xsl:value-of select="$myfullself" /> </xsl:message> </xsl:if> </xsl:for-each> </xsl:template> I hope this helps. . . . . . . . . . . . . . . Ken -- Comprehensive in-depth XSLT2/XSL-FO1.1 classes: Austin TX,Jan-2008 World-wide corporate, govt. & user group XML, XSL and UBL training RSS feeds: publicly-available developer resources and training G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Jul'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|