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

Re: logical and in selection expression possible?

Subject: Re: logical and in selection expression possible?
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Sat, 20 Jul 2002 02:15:51 +0200
xsl logical expression
Templates are applied for every root element in the node set returned by the key(). If a key('key', 'rulekey1') returns more than one node, "the template is being activated twice". With the union operator | you merge two node sets, i.e. a node that is member of both node sets is only once contained in the unioned node set.

But this seems more or less uninteresting in your case. I assume you want to do something completely different. You only want to "collect" the nodes and operate with them in one template? Then <xsl:call-template> could be the choice while passing the keys to the template via a parameter:

<xsl:call-template name="foo">
<xsl:with-param name="bar" select="key('key', 'rulekey1') | key('key', rulekey2')"/>
</xsl:call-template>



<xsl:template name="foo"> <!-- default value: empty node set --> <xsl:param name="bar" select="/.."/> ... </xsl:template>

But a more concrete explanation of your problem can help.

Regards,

Joerg

Alex Reuter wrote:
Ok, I've run into a bit of a snag.
When I am passing the union of the nodesets to the applied template, it appears that the template is being activated twice. I was hoping to be able to access both nodesets at the same time.... unless they are the children of the same parent, is this impossible?
Thanks,
Alex



From: David Carlisle <davidc@xxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  logical and in selection expression possible?
Date: Thu, 18 Jul 2002 17:17:29 +0100

<xsl:apply-templates select="key('key', rulekey1') and key('key',
'rulekey2') "/>

you want | there not and and is a boolean operator so this expression
will evaluate to true or false. but a select expression needs a node
set.


<xsl:template match="rule and rule2">


ditto.

David


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


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.