|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] matching by id in external document()
Hi
This template works - it accesses the correct target element in the external
document based on its id attribute matching the suffix of the local srcfile
attribute.
<xsl:template match="jump[@srcfile]">
<xsl:variable name="jfil">
<xsl:value-of select="substring-before(@srcfile,'#')" />
</xsl:variable>
<xsl:variable name="jid">
<xsl:value-of select="substring-after(@srcfile,'#')" />
</xsl:variable>
<xsl:copy>
<xsl:apply-templates select="@*[local-name() != 'text']"/>
<xsl:attribute name="text">
<xsl:value-of select="document($jfil,/)//target[@id = $jid]" />
</xsl:attribute>
</xsl:copy>
</xsl:template>
I was hoping that the following edit would be more efficient (it would
replace the 11th line of the preceding template):
<xsl:value-of select="document($jfil,/)/id($jid)" />
But this is an invalid XPath expression. What am I doing wrong?
Cheers
Trevor
|
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
|

Cart








