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

problem with proper numbering

Subject: problem with proper numbering
From: "Andreas Putscher" <andreasputscher@xxxxxx>
Date: Tue, 2 Oct 2001 09:51:52 +0200
proper numbering
Hi everybody,
I have a XML document I want to translate into a WML document, which should
include a table of contents linking to the other pages.
So I would like to transform "slidesets" and "slides" into "cards". The
problem I have is concerned with the numbering of the "cards".


a clipping of my code:

<!--TABLE OF CONTENTS WITH LINKS TO OTHER CARDS-->

<xsl:for-each select="slideset">
 <card>
  <xsl:attribute name="id"><xsl:number value="position()" format="a"/>
  </xsl:attribute>
  <xsl:attribute name="title"><xsl:value-of select="title"/></xsl:attribute>
  <p><b><xsl:text>slideset </xsl:text><xsl:value-of select="title"
/></b></p>

   <xsl:for-each select="./slide">
     <p><a>
     <xsl:attribute name="href">
      <xsl:text>#</xsl:text><xsl:number value="position()" format="a"/>
     </xsl:attribute>
     <xsl:value-of select="./title"/>
     </a></p>
  </xsl:for-each>
 </card>
</xsl:for-each>


<!--OTHER CARDS-->
<xsl:for-each select="slideset/slide">
  <card>
    <xsl:attribute name="id"><xsl:number value="position()"
format="a"/></xsl:attribute>
    <xsl:apply-templates/>
  </card>
</xsl:for-each>


As a result I get:


<!--TABLE OF CONTENTS OF FIRST SLIDESET-->
<card id="a" title="Basic Tests"><p><b>slideset Basic Tests</b></p>
 <p><a href="#a">Para test</a></p>
 <p><a href="#b">Preformatted test</a></p>
</card>

<!--TABLE OF CONTENTS OF SECOND SLIDESET-->
<card id="b" title="Item Drill Down Test"><p><b>slideset Item Drill Down
Test</b></p>
  <p><a href="#a">Item and flat list</a></p>
  <p><a href="#b">Item and bullet list</a></p>
</card>

<!--OTHER CARDS OF FIRST  SLIDESET-->
<card id="a"><p><b>Para test</b></p></card>
<card id="b"><p><b>Preformatted test</b></p></card>

<!--OTHER CARDS OF SECOND  SLIDESET-->
<card id="c"><p><b>Item and flat list</b></p></card>
<card id="d"><p><b>Item and bullet list</b></p></card>


So the position() function does not work in here as it starts numbering the
card-id with "a" again and again, but what I want is strictly ascending
numbering of the id.
I would like the result to look like:

<!--TABLE OF CONTENTS OF FIRST SLIDESET-->
<card id="a" title="Basic Tests"><p><b>slideset Basic Tests</b></p>
 <p><a href="#c">Para test</a></p>
 <p><a href="#d">Preformatted test</a></p>
</card>

<!--TABLE OF CONTENTS OF SECOND SLIDESET-->
<card id="b" title="Item Drill Down Test"><p><b>slideset Item Drill Down
Test</b></p>
  <p><a href="#e">Item and flat list</a></p>
  <p><a href="#f">Item and bullet list</a></p>
</card>

<!--OTHER CARDS OF FIRST  SLIDESET-->
<card id="c"><p><b>Para test</b></p></card>
<card id="d"><p><b>Preformatted test</b></p></card>

<!--OTHER CARDS OF SECOND  SLIDESET-->
<card id="e"><p><b>Item and flat list</b></p></card>
<card id="f"><p><b>Item and bullet list</b></p></card>

Can anybody help me with my problem?
Thanks in advance,
Andreas Putscher





 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.