Subject: [xsl] Where is 'intersect' Operator Defined in XPath 3? From: "Eliot Kimber eliot.kimber@xxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Mon, 8 Aug 2022 14:21:37 -0000 |
Ive been trying to remember how to get the intersection of node sets in XPath and by searching in https://www.w3.org/TR/xpath-functions-31 on intersect found this: 13.9 fn:outermost . $nodes[not(ancestor::node() intersect $nodes)]/. And using BaseX verified that this works: let $docs as element()* := db:open('tokyo')/* let $filter1 as element()* := $docs[self::concept] let $filter2 as element()* := $docs[contains(./title, 'install')] let $intersection as element()* := $filter1 intersect $filter2 return ( 'Total docs: ' || count($docs), 'Filter 1: ' || count($filter1), 'Filter 2: ' || count($filter2), 'Insertection: ' || count($intersection) ) However, if I search the XPath Functions and Operators or scan the ToC I cant find any mention of an intersect operator. Googling on xpath intersect operator the top hit is Saxon documentation: Set difference and intersection These operators were introduced in XPath 2.0. The expression E1 except E2 selects all nodes that are in E1 unless they are also in E2. Both expressions must return sequences of nodes. The results are returned in document order. For example, @* except @note returns all attributes except the note attribute. The expression E1 intersect E2 selects all nodes that are in both E1 and E2. Both expressions must return sequences of nodes. The results are returned in document order. For example, preceding::fig intersect ancestor::chapter//fig returns all preceding fig elements within the current chapter. So my question: Why can I not find the definition of the intersect operator in the XPath Functions and Operators spec? Thanks, E. _____________________________________________ Eliot Kimber Sr Staff Content Engineer O: 512 554 9368 M: 512 554 9368 servicenow.com<https://www.servicenow.com> LinkedIn<https://www.linkedin.com/company/servicenow> | Twitter<https://twitter.com/servicenow> | YouTube<https://www.youtube.com/user/servicenowinc> | Facebook<https://www.facebook.com/servicenow>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] [XSLT 2 or 3 - Diacritics, Dave Pawson dave.paw | Thread | Re: [xsl] Where is 'intersect' Oper, Norm Tovey-Walsh ndw |
Re: [xsl] [XSLT 2 or 3 - Diacritics, Dave Pawson dave.paw | Date | Re: [xsl] Where is 'intersect' Oper, Norm Tovey-Walsh ndw |
Month |