Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Nesting for each loops in XSL

From: "Han" <hp4444@------.---.----->
To: NULL
Date: 3/3/2005 1:09:00 PM
Try,

<xsl:for-each select="dbo.tblSubCategories">

instead of,

<xsl:for-each select="root/dbo.tblCategories/dbo.tblSubCategories">

-- 
Pohwan Han. Seoul. Have a nice day.
"Chris Kennedy" <ck001s7253nospam@b...> wrote in message 
news:egYW$J2HFHA.580@T......
>I want to display the category name, then all it's related subcategories
> beneath it.
>
> <root>
>
> <dbo.tblCategories CategoryID="1" Category="Category1">
>
> <dbo.tblSubCategories SubCategoryID="1" SubCategoryName="SubCategory1" />
>
> <dbo.tblSubCategories SubCategoryID="2" SubCategoryName="SubCategory2" />
>
> <dbo.tblSubCategories SubCategoryID="3" SubCategoryName="SubCategory3" />
>
> </dbo.tblCategories>
>
> <dbo.tblCategories CategoryID="2" Category="Category2">
>
> <dbo.tblSubCategories SubCategoryID="4" SubCategoryName="SubCategory4" />
>
> <dbo.tblSubCategories SubCategoryID="5" SubCategoryName="SubCategory5" />
>
> <dbo.tblSubCategories SubCategoryID="6" SubCategoryName="SubCategory6" />
>
> </dbo.tblCategories>
>
> </root>
>
> Can anyone tell me what I am doing wrong in my xsl file?
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <xsl:stylesheet version="1.0":xsl="http://www.w3.org/1999/XSL/Transform">
>
> <xsl:template match="/">
>
> <html>
>
> <body>
>
> <table border="1">
>
> <tr bgcolor="#EEEEEE">
>
> <th align="left">Category</th>
>
> </tr>
>
> <xsl:for-each select="root/dbo.tblCategories">
>
> <tr>
>
> <td><xsl:value-of select="@Category"/></td>
>
> <xsl:for-each select="root/dbo.tblCategories/dbo.tblSubCategories">
>
> <td><xsl:value-of select="@SubCategoryName"/></td>
>
> </xsl:for-each>
>
> </tr>
>
> </xsl:for-each>
>
> </table>
>
> </body>
>
> </html>
>
> </xsl:template>
>
> </xsl:stylesheet>
>
>
>
>
>
>
> 



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent