[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Pipe Question

Subject: RE: Pipe Question
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 9 Jun 2005 09:43:37 +0100
xml pipe
> If defined like this:
> <xsl:param name="my_param" select="/"/>
> 
> Or this:
> <xsl:param name="my_param" select="."/>
> 
> 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?

No, you don't get a copy, you get the original.
> 
> $match is a parameter for one of my templates.  The intent of the
> template:  SELECT ALL -or- SELECT ALL where @component = $match.
> 
> In this example:
> <xsl:template match="X[@component=$match] | 
> X[not(@component=$match)]"/>
> 
> Select ALL X elements who's @component is one of the $match elements
> -OR- when $match does not exist, SELECT ALL. 

If a variable doesn't exist, you get an error. For any condition,

match="X[condition] | X[not(condition)]"

is equivalent to

match="X"

except in the special case where evaluating the condition causes an error.

Michael Kay
http://www.saxonica.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.