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

RE: constructing the Node Sets

Subject: RE: constructing the Node Sets
From: "Roger Glover" <glover_roger@xxxxxxxxx>
Date: Tue, 28 Jan 2003 00:39:11 -0600
constructing a node
Idea copied from Michael Kay's "XSLT Programmer's Reference", 2nd ed., Wrox
Press, 2001, p. 425 ...

<xsl:variable name="C" select="$A[ count( . | $B ) = count( $B ) ]"/>

The select expression selects the node subset C of node set A, composed of
any member node of A which, when added to node set B, produces a node set
the same size as B (in other words, the node was already in node set B).

The usage of A and B in the select expression can be reversed with no side
effects except possibly:
    o   a change in the list ordering of nodes in node set C
    o   a change in the speed of execution of the expression

-- Roger Glover

Siva Jasthi wrote
> I have constructed two variables (A and B) each of which contains a Node
> Set (through select="XPath Expression").
>
> A = [Node1, Node2, Node3, Node4, Node5]
> B = [Node3, Node4, Node5, Node6, Node7, Node8]
>
> I now would like to construct another variable C with the Nodes that exist
> both in A and B.  (So as to produce a third table with the Nodes that are
> common to both A and B).
>
> C= [Node3, Node4, Node5]
>
> Is there any way to construct C from A and B?.



 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.