RE: [xsl] What is wrong with this count()

Subject: RE: [xsl] What is wrong with this count()
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 26 Sep 2005 14:34:50 +0100
In XSLT 1.0 this should give you an error: the argument of count() must be a
node-set, not a boolean. (It's actually one of the few type errors you can
get from XSLT 1.0).

In 2.0 the count() of a boolean value is always one (a single value is a
sequence of length one).

I don't know what result you wanted: perhaps

 count(*[starts-with(name(),'DGBUIMSNNumber')][@action='add'])

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



> -----Original Message-----
> From: Khorasani, Houman [mailto:houman_khorasani@xxxxxxxxxxxxxx] 
> Sent: 26 September 2005 13:23
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] What is wrong with this count()
> 
> Hello everyone,
> 
> I am trying hard to figure out why this isn't working:
> 
> 
> count(*[starts-with(name(),'DGBUIMSNNumber')]/@action='add')
> 
> It always returns 1.  Why? 
> 
> Many thanks,
> Houman

Current Thread