[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Processing Nested Lists
Adam Retter wrote: Hi > <xsl:template name="processNode"> > <xsl:parameter name="node"/> > <tr> > <td><xsl:value-of select="{node-name($node)}"/></td> > </tr> > <xsl:for-each select="$node/child::node"> > <xsl:call-template name="processNode"> > <xsl:with-parameter name="node" select="."/> > </xsl:call-template> > </xsl:for-each> > </xsl:template> > <xsl:for-each select="/TopTag/TaxonomyEntries/TaxonomyNode"> > <xsl:call-template name="processNode"> > <xsl:with-parameter name="node" select="."/> > </xsl:call-template> > </xsl:for-each> This is exactly the kind of stuff template rules are for. In other words, to apply code to some sequence of nodes: apply template rules to nodes instead of calling named template passing nodes by parameters and using xsl:for-each. For example, the code above can be written (the intention above is not precisely clear, but you'll got the idea): <xsl:template match="*"> <tr> <td> <xsl:value-of select="name(.)"/> </td> </tr> <xsl:apply-templates select="*"/> </xsl:template> ... <xsl:apply-templates select="/TopTag/TaxonomyEntries/TaxonomyNode"> Regards, --drkm ___________________________________________________________________________ Dicouvrez une nouvelle fagon d'obtenir des riponses ` toutes vos questions ! Profitez des connaissances, des opinions et des expiriences des internautes sur Yahoo! Questions/Riponses http://fr.answers.yahoo.com
|
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
|