xsl-list
[Top] [All Lists]

Re: Pipe Question

2005-06-08 13:51:54


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
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--