[Home] [By Thread] [By Date] [Recent Entries]
Scenario: A company can have many offices and branch companies
Each brach can have 0+ offices and their brach companies
Basically it is a tree, and I want to print its elements.And the xsl given below fails. I am trying to have multiple nodes which may have multiple children. Basically it works for company uno and its office location, and there it stops! Thanks in advance, Rosh Here is the xml: <company name="Uno" > <office location="nyc" rent="2000"/> <company name="Dos"/> <company name="Tres"/> <company name="Quatro"> <office location="paris" rent="2500"/> </company> </company> ------- xsl ------- <xslt:transform xmlns:xslt="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/*">
<xsl:value-of select="."/>
<xsl:for-each select="company">
<xsl:apply-templates select="company"/>
</xsl:for-each>
</xsl:template><xsl:template match="office"> <xsl:value-of select="."/> <xsl:apply-templates select="office"/> </xsl:template> _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|

Cart



