Subject: RE: Need Help in Creating folder tree(html) from xtm document using xslt
From: Américo Albuquerque <melinor@xxxxxxx>
Date: Fri, 8 Aug 2003 02:31:34 +0100
|
Hi.
> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
> velmurugan mariappan
> Sent: Thursday, August 07, 2003 7:42 PM
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject: 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
|