[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Need Help in Creating folder tree(html) from xtm d

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
creating tree in html
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.