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

Re: Param Element

Subject: Re: Param Element
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 3 Jun 2005 10:00:03 +0100
Re:  Param Element
  How do you select the root element of a parm and guarantee that it is
  not the root element of the source

If the current node is in your source and a parameter x contains a root
nodeof another document then

select="/" selects the root node of the source.
select="$x" selects the root node of the other document
select="$x|/" selects both nodes.

In your case though, unless you are passing in anohter document as an
external parameterm your parameter and your input document are the same
node (not just equal values, but actually teh same thing) so in this
case


select="/" select="$x"select="$x|/" all just select a single node, the
root node of your input.

> This is working properly, where activity_id is a RTF of existing
> activity id's. 

In the code that you posted, activity_id, was a node set not a result
tree fragment, and the test would always be true. 
 <xsl:apply-templates select="row"/>
produces no output and
<xsl:apply-templates select="$xm/row" mode="append"/>
produces a copy of the input, as the test is always true, so nothing is
filtered.

It is always true if $xm has its default value as $current_id =
$activity_id is true if the string value of $current_id is equal to the
string value of one of the nodes in the node set $activity_id.  But you
know in advance that the node $current_id is in the node set
$activity_id so clearly its string value is equal to itself, so the test
is true. If the xm parameter is a different document to the source
document then it is not necessaril always true as then  $current_id
is a node in the xm parameter and  $activity_id is a set of nodes in the
main document, but as I said, in that case your construction is
equivalent to


<xsl:copy-of select="$xm/row[@id = $activity_id]"/>

ie copy all rows from xm that have an id equal to a row in the main
document.

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

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.