[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsl:apply-templates in combination with xsl:choose
Stefanie Haupt wrote:
<xsl:template match="filesystem"> ..... Well inside of an xsl:template match="filesystem" the expression file/document(.) gives you a sequence of document nodes of all 'file' child elements and that way test="file/document(.)/xh:html/xh:head/xh:link/attribute::rel[contains(.,'stylesheet')]" checks whether there is a link rel="stylesheet" element in at least one of the files referenced by all the 'file' child elements of the 'filesystem' element. So you probably rather want e.g. <xsl:template match="filesystem"> <xsl:apply-templates select="file"/> </xsl:template> <xsl:template match="file"> <xsl:choose> <xsl:when test="document(.)/xh:html/xh:head/xh:link/attribute::rel[contains(.,'stylesheet')]"> <xsl:apply-templates select="." mode="neuerTest"/> </xsl:when> <xsl:when test="document(.)/xh:html/xh:head/xh:title[contains(.,'Mag')]"> <xsl:apply-templates select="." mode="someOtherMode"/> </xsl:when> </xsl:choose> </xsl:template> <xsl:template match="file" mode="neuerMode"> ... </xsl:template> <xsl:template match="file" mode="someOtherMode"> ... </xsl:template> -- Martin Honnen http://msmvps.com/blogs/martin_honnen/
|
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
|