|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Urgent : Nested List Help
Hi Sefa,
Please try this XSL -
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" />
<xsl:template match="links">
<html>
<head>
<SCRIPT SRC="links.js" LANGUAGE="javascript"
TYPE="text/javascript" />
</head>
<body>
<ul>
<xsl:apply-templates />
</ul>
</body>
</html>
</xsl:template>
<xsl:template match="link">
<xsl:choose>
<xsl:when test="*">
<li>
<xsl:value-of select="@name" />
<ul>
<xsl:apply-templates />
</ul>
</li>
</xsl:when>
<xsl:otherwise>
<li>
<xsl:value-of select="@name" />
</li>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Regards,
Mukul
--- Sefa Sevtekin <sevtekin@xxxxxxxxxxx> wrote:
> Hello Pieter,
>
> Thanks for your reply but unfortunately it doesn't
> help. What I want is the
> XSL that exactly produces this html output:
>
>
> -----------------
>
> <html>
> <head>
> <META http-equiv="Content-Type" content="text/html;
> charset=UTF-8">
> <SCRIPT SRC="links.js" LANGUAGE="javascript"
> TYPE="text/javascript"></SCRIPT>
> </head>
> <body>
> <ul>
> <li>1
> <ul>
> <li>1.1</li>
> <li>1.2
> <ul>
> <li>1.2.1</li>
> <li>1.2.2</li>
> </ul>
> </li>
> </ul>
> </li>
> <li>2
> <ul>
> <li>2.1
> <ul>
> <li>2.1.1</li>
> <li>2.1.2</li>
> <li>2.1.3</li>
> </ul>
> </li>
> <li>2.2
> <ul>
> <li>2.2.1</li>
> <li>2.2.2</li>
> <li>2.2.3</li>
> </ul>
> </li>
> <li>2.3</li>
> </ul>
> </li>
> <li>3</li>
> </ul>
> </body>
> </html>
>
> -------------------------------------------
>
> And here is the XML in case you'd need it;
>
> -----------------------------------------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <?xml-stylesheet type="text/xsl" href="links.xsl"?>
> <links>
> <link name="1">
> <link name="1.1"/>
> <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>
> -----------------------------------
>
> Thanks in advance for your help,
> Sefa
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com
|
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








