xsl-list
[Top] [All Lists]

RE: xsl:number function error

2005-04-24 15:17:01
I agree with you, it should be 11.

What XSLT processor are you using?

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: tsterlin(_at_)email(_dot_)arizona(_dot_)edu 
[mailto:tsterlin(_at_)email(_dot_)arizona(_dot_)edu] 
Sent: 24 April 2005 22:25
To: XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] xsl:number function error

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



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>