|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Urgent : Nested List Help
Hi, I am trying to transform an XML file by using XSL and display it as
html. Here is the XML:
<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="links.xsl"?> <links> <link name="1"> <link name="1.1" url="#"/> <link name="1.2"> <link name="1.2.1"/> <link name="1.2.2"/> </link> </link> <link name="2"> <link name="2.1"> <link name="2.1.1"/> <link name="2.1.2"/> <link name="2.1.3"/> </link> <link name="2.2"> <link name="2.2.1"/> <link name="2.2.2"/> <link name="2.2.3"/> </link> <link name="2.3"/> </link> <link name="3"/> </links> and here is the XSL: <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <head> </head> <body> <ul> <xsl:apply-templates select="links/link"/> </ul>
<xsl:template match="link"> <li> <xsl:value-of select="@name"/> </li> <xsl:apply-templates /> </xsl:template> <xsl:template match="link/link"> <li> <xsl:value-of select="@name"/> </li> <ul> <xsl:apply-templates /> </ul> </xsl:template> </xsl:stylesheet> and here is the output html:
The problem is xsl creates empty <ul></ul> in between. Can you help me fix it? Thanks
|
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








