|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: How to build a drill-down list from XML using XSL?
Try this <xsl:template match="/"> <HTML> <BODY> <xsl:for-each select="Table/Partner//Type[not(. = following::Type)] | Table/Partner//Division[not(. = following::Division)] | Table/Partner//ChannelRep[not(. = following::ChannelRep)]"> <UL><xsl:value-of select="Type"/> <UL><xsl:value-of select="Division"/> <UL><xsl:value-of select="."/> <xsl:for-each select="//Partner[ChannelRep=current()]"> <UL><A> <xsl:attribute name="href">http://W1116207/channel/echo.asp?value=<xsl:value-of select="Name"/> </xsl:attribute> <xsl:attribute name="target">view</xsl:attribute> <xsl:value-of select="Name"/> </A></UL> </xsl:for-each> </UL> </UL> </UL> </xsl:for-each> </BODY> </HTML> </xsl:template> Francis > Here's a snippet of my XML data file: > > <?xml version="1.0"?> > <?xml-stylesheet type="text/xsl" href="channel.xsl"?> > <Table> > <Partner> > <Type>HVAC</Type> > <Division>Chatham</Division> > <ChannelRep>John</ChannelRep> > <Name>ABC Heating</Name> > </Partner> > <Partner> > <Type>HVAC</Type> > <Division>Chatham</Division> > <ChannelRep>John</ChannelRep> > <Name>DEF Heating</Name> > </Partner> > <Partner> > <Type>Retail</Type> > <Division>London</Division> > <ChannelRep>Joe</ChannelRep> > <Name>XYZ Hardware</Name> > </Partner> > </Table> > > I want to display this like: > > HVAC > | > --Chatham > | > -- John > | > --ABC Heating > DEF Heating > Retail > | > --London > | > -- Joe > | > --XYZ Hardware > > Joseph Tam XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








