Altova Mailing List Archives


Re: [xsl] Pipe Question

From: David Carlisle <davidc@--------->
To:
Date: 6/8/2005 8:53:00 PM
> 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
________________________________________________________________________

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.