Hi.
-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of
velmurugan mariappan
Sent: Thursday, August 07, 2003 7:42 PM
To: XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Need Help in Creating folder tree(html) from
xtm document using xslt
HI everyone,
I need help in creating a folder tree from an xtm
document using xslt.
Try this:
<xsl:output method="html"/>
<xsl:key match="xtm:topic" name="topics"
use="xtm:instanceOf/xtm:topicRef/@xlink:href"/>
<xsl:key match="xtm:topic" name="first" use="not(xtm:instanceOf)"/>
<xsl:template match="xtm:topicMap">
<style> LI { LIST-STYLE-TYPE: none; } </style>
<ul>
<xsl:apply-templates mode="first"
select="xtm:topic[xtm:subjectIdentity/xtm:subjectIndicatorRef/@xlink:href=co
ncat('#',current()/@id)]"/>
</ul>
</xsl:template>
<xsl:template match="xtm:topic" mode="first">
<li>
<xsl:apply-templates select="xtm:baseName"/>
<ul>
<xsl:apply-templates
select="key('first',true())[not(generate-id()=generate-id(current()))]"/>
</ul>
</li>
</xsl:template>
<xsl:template match="xtm:topic">
<li>
<xsl:apply-templates select="xtm:baseName"/>
<xsl:if test="key('topics',concat('#',@id))">
<ul>
<xsl:apply-templates select="key('topics',concat('#',@id))"/>
</ul>
</xsl:if>
</li>
</xsl:template>
(...)
Hope this helps.
Regards,
Americo Albuquerque
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list