Project

Profile

Help

count() doesn't work in version 8.7.3j

Added by Anonymous almost 18 years ago

Legacy ID: #3842223 Legacy Poster: Konrad Windszus (kwin)

The following xsl cannot be compiled with Saxon <xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='2.0'> <xsl:template match="/"> <xsl:value-of select="count()" /> </xsl:template> </xsl:stylesheet> The error is: Failed to compile stylesheet. 1 error detected. As soon as I replace count() with position() for example everything works well. Other XSLT-Processors don't have any problems with this xsl. Please help. Thanks in advance Konrad


Replies (3)

Please register to reply

RE: count() doesn't work in version 8.7.3j - Added by Anonymous almost 18 years ago

Legacy ID: #3842841 Legacy Poster: Michael Kay (mhkay)

The count() function takes a mandatory argument, the sequence whose items you want to count. No processor should accept this code, it's incorrect in both XSLT 1.0 and XSLT 2.0. I can't even imagine what you thought it might do if it were permitted. Calling position() with no arguments is fine, because position() doesn't take any arguments. Michael Kay http://www.saxonica.com/

RE: count() doesn't work in version 8.7.3j - Added by Anonymous almost 18 years ago

Legacy ID: #3845955 Legacy Poster: Konrad Windszus (kwin)

Thanks for your answer. The strange thing is, that XMLSpy didn't throw that error. I don't know what it takes as standard parameter.

RE: count() doesn't work in version 8.7.3j - Added by Anonymous almost 18 years ago

Legacy ID: #3845961 Legacy Poster: Michael Kay (mhkay)

>The strange thing is, that XMLSpy didn't throw that error. You should send a bug report to Altova. I'm sure they are anxious to improve the conformance of their product.

    (1-3/3)

    Please register to reply