|
Subject: [xsl] need help on referencing From: Lenny Wu <lenny.wu@xxxxxxxxxxx> Date: Fri, 14 Nov 2003 01:19:22 -0500 |
"tutorial.xml
<tutorial>
<author idref="1"/>
</tutorial>author.xml
<authors>
<author id="1">
<name>foo</name>
</author>
<author id="2">
<name>bar</name>
</author>
</authors>XSL
<xsl:template match="tutorial">
<xsl:copy>
<xsl:apply-templates select="author"/>
</xsl:copy>
</xsl:template>
<xsl:template match="author">
<xsl:copy>
<xsl:copy-of select="document('author.xml')/authors/author[@id =
current()/@idref]/name"/>
</xsl:copy>
</xsl:template>output should be:
<tutorial>
<author>
<name>foo</name>
</author>
</tutorial>
"tutorial.xml (which is transformed)
<tutorial>
<author> 1 </author>
</tutorial>author.xml
<authors>
<author>
<id> 1 </id>
<name>foo</name>
</author>
<author>
<id> 2 </id>
<name>bar</name>
</author>
</authors>| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Sablotron and PHP, Cas Tuyn | Thread | RE: [xsl] need help on referencing, Andreas L. Delmelle |
| Re: [xsl] Sablotron and PHP, Paul Sleigh | Date | [xsl] XHTML Output, Todd Baker |
| Month |