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

Re: Any suggestion.

Subject: Re: Any suggestion.
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Tue, 22 Aug 2000 08:46:33 +0100
Re: Any suggestion.
Hi,

>>  <xsl:variable name="totalChapters">  <xsl:value-of
>> select="//chapter[last()]"/>  </xsl:variable>  
>>  <xsl:template match="/">  <xsl:value-of select="$totalChapters"/>
>> </xsl:template>  

I'm probably jumping to conclusions, but from the names of the variables it
looks as if you were after the number of chapters in the source?  If that's
the case, then you probably want:

  <xsl:variable name="totalChapters" select="count(//chapter)" />

If you *did* want to get hold of the last chapter, you're usually better
off using a 'select' attribute to get the node that you're interested in
rather than storing its value as a result tree fragment (which is what
happens when you set the value of a variable through its content):

  <xsl:variable name="totalChapters" select="//chapter[last()]" />

I've no idea why it's not working, but it's probably to do with using an
old version of MSXML - see http://www.netcrucible.com/xslt/msxml-faq.html.

Sorry I can't be more help,

Jeni

Jeni Tennison
http://www.jenitennison.com/


 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-2011 All Rights Reserved.