I'm trying to perform a lookup to a 2nd XML document in order to convert a code to a real value, but I can't find any examples that work with my file format.
I have tutorial.xml
<tutorial>
<author idref="1"/>
</tutorial>
.. and author.xml
<authors>
<author id="1" word="one">
<name>foo</name>
</author>
<author id="2" word="two">
<name>bar</name>
</author>
</authors>
I have the following section in my XSL and am able to return the value 'foo'...
<xsl:template match="author">
<xsl:copy>
<xsl:copy-of select="document('author.xml')/authors/author[@id =current()/@idref]/name"/>
</xsl:copy>
</xsl:template>
BUT.. really I want to return 'one', but I can't figure out the syntax required to use the @word attribute.
Can anyone help?
I have tutorial.xml
<tutorial>
<author idref="1"/>
</tutorial>
.. and author.xml
<authors>
<author id="1" word="one">
<name>foo</name>
</author>
<author id="2" word="two">
<name>bar</name>
</author>
</authors>
I have the following section in my XSL and am able to return the value 'foo'...
<xsl:template match="author">
<xsl:copy>
<xsl:copy-of select="document('author.xml')/authors/author[@id =current()/@idref]/name"/>
</xsl:copy>
</xsl:template>
BUT.. really I want to return 'one', but I can't figure out the syntax required to use the @word attribute.
Can anyone help?