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

RE: XSL resources - Flat to hierarchy - Common ancesto

Subject: RE: XSL resources - Flat to hierarchy - Common ancestors
From: "Ben Simkins" <bsimkins@xxxxxxxxxx>
Date: Tue, 27 Jul 2004 10:14:03 +0200
hierarchy and flat structures
> > 2. Transforming 'flat' structures to hierarchies:
> ....
>
> Wrap the first apply-templates into a variable, use your processors
node-
> set()
> function (see your processors documentation on how to implment this)
to
> convert
> the result into a node-set and then apply-templates or for-each
through
> the
> resulting node-set using <xsl:number/> to accomplish the task
>
I'm supposed to be doing something else, but I just had to try this out
:)
Having 'learnt' XSL by cut and paste, I think I'm still at the stage
where I need subtitles.
I added xmlns:msxsl="urn:schemas-microsoft-com:xslt" to my
xsl:stylesheet declaration, and my first template now looks like this:

<xsl:template match="/">
  <xsl:variable name="menus">
	<xsl:apply-templates select="Menus"/>
  </xsl:variable>
  <xsl:for-each select="msxsl:node-set($menus)">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <xsl:attribute name="TOC">
        <xsl:number level="multiple" format="1.1"/>
      </xsl:attribute>
    </xsl:copy>
  </xsl:for-each>
</xsl:template>

Obviously, it doesn't work, otherwise I wouldn't be posting. I guess
what I don't understand is whether my for-each is for each node in the
nodeset.  You suggested mayb using an apply-templates, but I don't
really understand how to do an apply templates which won't eat my other
menus upstream (ok, I'll be honest, I just don't understand
apply-templates ;)

Ben

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.