|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








