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

xsl:number function error

Subject: xsl:number function error
From: tsterlin@xxxxxxxxxxxxxxxxx
Date: Sun, 24 Apr 2005 14:25:27 -0700
xsl number function
For some reason it seems that the xsl:number function is not functioning
properly...has anyone ever seen this before?

Here's the XML input I'm working with.

<?xml version="1.0" encoding="UTF-8"?>

<DOC>
  <FRONT>
     <MAINGRP>
         <TITLE>NOTES TO READERS</TITLE>
         <MAINGRPPARA0>
         </MAINGRPPARA0>
         <MAINGRPPARA0>
         </MAINGRPPARA0>
         <MAINGRPPARA0>
         </MAINGRPPARA0>
         <MAINGRPPARA0>
         </MAINGRPPARA0>
     </MAINGRP>
     <MAINGRP>
         <MAINGRPPARA0>
         </MAINGRPPARA0>
         <MAINGRPPARA0>
         </MAINGRPPARA0>
         <MAINGRPPARA0>
         </MAINGRPPARA0>
      </MAINGRP>
      <MAINGRP>
         <TITLE/>
      </MAINGRP>
      <MAINGRP>
         <TITLE>LIST OF EFFECTIVE PAGES</TITLE>
         <MAINGRPPARA0>
         </MAINGRPPARA0>
      </MAINGRP>
      <MAINGRP>
         <TITLE>LIST OF ASSOCIATED PUBLICATIONS</TITLE>
         <MAINGRPPARA0>
         </MAINGRPPARA0>
         <MAINGRPPARA0>
         </MAINGRPPARA0>
         <MAINGRPPARA0>
         </MAINGRPPARA0>
      </MAINGRP>
  </FRONT>
  <BODY>
           <MAINGRP>
               <TITLE>INTRODUCTION</TITLE>
               <MAINGRPPARA0>
                </MAINGRPPARA0>
            </MAINGRP>
  </BODY>
</DOC>

And here's the pertinent portion of my stylesheet:

<xsl:template match="MAINGRP">
  <xsl:choose>
    <xsl:when test="ancestor::FRONT"/>
    <xsl:otherwise>
      <xsl:number level="any" count="MAINGRPPARA0"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

The strange thing is it's outputting a 9 when it reaches that first <MAINGRP>
child of <BODY>, but it should be an 11.  Has anyone encountered this problem
with the xsl:number function before...is there some issue with the nesting of
the ancestoral children??

Thanks,
-Tracy

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.