Re: [xsl] Pipe Question

Subject: Re: [xsl] Pipe Question
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 8 Jun 2005 21:51:54 +0100
> Where the "()" select will evaluate to an empty sequence when none was
> supplied.  I understand that it could be any valid xpath expression.

I forget whether you are using xslt2 or 1, if using one you can't use ()
but you can use /.. to swlwct an empty node set.

> And the param "my_param" is not supplied you will end up with a copy
> of the document source "/" or current context "." (respectively).  Do
> I have this correct?

for a top level param the current context is the root node so . and /
are the same thing. You don't get a copy the vaiable is bound to the
same node. so for example the counting the node set 
count($my_paran | / )
of the parameter and the document root would return 1 not 2. In
particular defining a parameter this way is not expensive (whereas doing
<xsl:copy-of select="/"/> is expensive and generates a copy of the input
(if it is being copied into a variable.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread