Re: [xsl] Adding subtotals to a report

Subject: Re: [xsl] Adding subtotals to a report
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 19 Apr 2002 17:41:21 +0100
> Project[current()]

That selects all Project elements for which the predicate current() is
true current() returns a node set of size one containing the current
node, and node sets convert to true if they are non empty. As this is
never non empty, it is the same as

Project[true()]

which is the same as 

Project


> It gives me the same result as if I had used last().

yes last() also always returns a non empty node set.


> What I was trying to do was look for a Project element which has an
> attribute named ProjectName and the value is equal to the current
> ProjectName attribute.  When I tried putting current() in there like
> so: 


your descritption refered to two ProjectName attributes but your
expression did not refer to any...


Project[@ProjectName=current()/@ProjectName]

Selects all the Project elements that you describe.

Also your example is looking for @Total, ie a Total attribute but your
small input example has no such attributes, only TotalDiff

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread