|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: :apply-templates in another document
Hi Stefan,
> I need to apply-templates on a second .xml file referenced by a first .xml
> where which references a .xsl sheet.
>
> I try following:
> ...
> <xsl:apply-templates
> select="document(@tag)/tag/description/@*|node()">
> <xsl:with-param name="level" select="$level"/>
> </xsl:apply-templates>
The trouble is that the XPath you're using to select the content of
the document is parsed as:
(document(@tag)/tag/description/@*) | node()
In other words, you apply templates to the attributes of the
<description> element in the second .xml file, and the node() children
of the context node in the first .xml file.
The easiest thing would be to change the select attribute to:
document(@tag)/tag/description
and add a template that matched the <description> element and applied
templates to its attributes and children:
<xsl:template match="description">
<xsl:param name="level" />
<xsl:apply-templates select="@* | node()">
<xsl:with-param name="level" select="$level" />
</xsl:apply-templates>
</xsl:template>
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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








