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

RE: Xref numbering test

Subject: RE: Xref numbering test
From: "Andrew Welch" <AWelch@xxxxxxxxxxxxxxx>
Date: Wed, 17 Dec 2003 08:49:25 -0000
xsl and count
Wendell:
> ><xsl:template match="step1|step2...">
> >   <xsl:variable name="currentId" select="@id"/>
> >   <xsl:for-each select="$steps">
> >     <xsl:value-of select="step[@id = $currentId]/@number"/>
> 
> 1. This will only work when using XSLT 2.0, or a node-set extension 
> function, since ordinarily (in XSLT 1.0) you cannot iterate 
> over, or query 
> into, a result-tree-fragment this way.

True.  But there's no need to spell *everything* out is there?  Surely a
point in the right direction is better than a 'cut and paste' in the
long run...

> 2. Even so, how is it better than simply calculating the 
> number of each 
> step using the same <xsl:number count="step1|step2|..." ... 
> /> instruction, 
> where you need it?
> 
> <xsl:template match="step1|step2...">
>    <xsl:variable name="currentId" select="@id"/>
>    <xsl:for-each select="$steps">
>      <xsl:value-of select="step[@id = $currentId]/@number"/>
>      ...
> 
> could as easily be
> 
> <xsl:template match="step1|step2...">
>    <xsl:number count="step1|step2....| " .../>
> 
> (Look ma, no variable.)

I recognise the element names and have worked on this kind of dtd for a
few years, so (I think) I know the requirements even if norma didn't
quite spell them out :)

I still stand by using variables in this situation, they really help
maintaining and debugging the process involved.

cheers
andrew

 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.