xsl-list
[Top] [All Lists]

Re: Wath is the opposite of the union operator?

2005-09-22 05:02:11
Thanks, that's go directly to my personal archive...

On 9/22/05, Michael Kay <mike(_at_)saxonica(_dot_)com> wrote:
Subject: [xsl] Wath is the opposite of the union operator?

Or puting it in another way, how do i select a group of nodes selected
by some xpath expression EXCEPT the ones that are selected by another
xpath expression?

The operation you are referring to is usually called "set difference". In
XPath 2.0, the operator is spelt "except".  There is also a set intersection
operator spelt "intersect". There's no equivalent to these in XSLT 1.0,
though some processors support the EXSLT set:difference() and
set:intersection() functions. You can expensively code

A except B =>

   A[count(.|B) != count(B)]

A intersect B =>

   A[count(.|B) = count(B)]

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



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--