This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Adding subtotals to a report
- From: David Carlisle <davidc at nag dot co dot uk>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Fri, 19 Apr 2002 17:41:21 +0100
- Subject: Re: [xsl] Adding subtotals to a report
- References: <E953ED9A6CB499478E0F33F639B1D7AC290DA9@phase2-s11.phase2.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
> 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