|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: constructing the Node Sets
David Carlisle wrote:
> > I expected that the intersection of a and b will produce a count of 2,
>
> ah. In that case you asked the wrong question.
>
> Your node sets are disjoint, no node has both @name='Asm' and @name='Cmp'
> so the intersection of the sets $a and $b is empty.
>
> You don't want the intesection of the sets, you want all elements of $a
> that have a string value equal to some member of $b, that's easier than
> the question you asked,
>
> $a[.=$b]
Err... I think that you mean:
$a[@obid = $b/@obid]
Right? The standard for "equality" is that the "obid" attributes have the
same value. Your expression will result in "$a" all over again, since all
the elements in "$a" and "$b" have empty string values.
> except that if you have the possibility of duplicate obid values you may
> need to remove duplicates as well.
>
> Note that
> $a[ count( . | $b ) = count( $b ) ]
> is the same as
> $b[ count( . | $a ) = count( $a ) ]
> it really is the nodes in both $a and $b,
Well, except possibly for order, as I noted earlier.
> but
>
> $a[.=$b]
$a[@obid = $b/@obid]
> is not the same
> as
>
>
> $b[.=$a]
$b[@obid = $a/@obid]
> one is the set of nodes in $a the other is the set in $b.
Right, in the first expression all the "Class" elements will have a "name"
attribute with the value "Asm". In the second expression all the "Class"
elements will have a "name" attribute with the value "Cmp".
-- Roger Glover
glover_roger@xxxxxxxxx
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








