xsl-list
[Top] [All Lists]

Re: [xsl] Getting Unexpected Results from .//* = $set-of-elements

2018-02-24 14:17:26
So my misunderstanding of "=" is that it is comparing values, not nodes--I 
clearly never understood that properly.

That then explains why an empty element would produce the results I was seeing: 
"" is equal to any other empty node.

Doh!

I will try Mike's intersection expression.

Cheers

W.

--
Eliot Kimber
http://contrext.com
 
On 2/23/18, 6:39 PM, "Michael Kay mike(_at_)saxonica(_dot_)com" 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

    
    > On 24 Feb 2018, at 00:18, G. Ken Holman 
g(_dot_)ken(_dot_)holman(_at_)gmail(_dot_)com 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:
    > 
    > Ignore that second expression ... I wrote it too hastily and I'm now back 
at my desk to think about it.
    > 
    > This would work I think:
    > 
    >  <xsl:value-of select="some $this in .//* satisfies
    >                        some $that in $elements-to-keep
    >                        satisfies $this is $that"/>
    > 
    
    I think that's equivalent to saying that the intersection of the two sets 
is non empty:
    
    select="exists(.//* intersect $elements-to-keep)"
    
    Michael Kay
    Saxonica
    
    
    
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>