[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: Tue, 16 Dec 2003 13:27:33 -0000
welch test
> Thanks for reply but maybe I didn't make want I want clear.
> The xref has a xidtype of step but my elements are step1 
> step2 step3. I need to know whether the step is a step1 or 
> step2 etc. in order to number it correctly.
> 
> <xref xrefid="step1-10" xidtype="step"></xref> 
> 
> The xrefid includes the step level a dash and increments
> If I could test the id or test the element being referenced 
> then I could proceed.
> 
> Again, thanks for the help.

Norma,

First build a nodeset of all the <stepX>'s with their id's and how you
want to number them:

<xsl:variable name="steps">
  <xsl:for-each select="//step1|//step2|....|//step9">
    <step id="{@id}">
      <xsl:attribute name="number">
        <xsl:number count="step1|step2....|

And so on.

This will give you a variable holding something like:

<step id="1234" number="1."/>
<step id="1abc2" number="1.1."/>

Then in your step processing template, query the variable for the
correct number using the id of the step you are processing:

<xsl:template match="step1|step2...">
  <xsl:variable name="currentId" select="@id"/>
  <xsl:for-each select="$steps">
    <xsl:value-of select="step[@id = $currentId]/@number"/>



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.