Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Nesting for each loops in XSL [Thread Next] Re: Nesting for each loops in XSLTo: 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> > > > > > > > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
