Subject: Re: Any suggestion. From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx> Date: Tue, 22 Aug 2000 08:46:33 +0100 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Any suggestion., Mike Brown | Thread | to extract the longest string. (fwd, C.V. Radhakrishnan |
Re: how to use // starting from the, Jeni Tennison | Date | RE: problems again!, Pawson, David |
Month |