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

Re: Using node-set variables in predicates (another no

Subject: Re: Using node-set variables in predicates (another node comparison question)
From: "Dimitre Novatchev dnovatchev@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 2 Jan 2022 23:12:09 -0000
Re:  Using node-set variables in predicates (another no
On Sun, Jan 2, 2022 at 2:42 PM Chris Papademetrious
christopher.papademetrious@xxxxxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> Thanks Michael, Martin! This list is great.
>
>
>
> Given the many articles on the various ways of comparing identicality in
> XSLT 2+, I was surprised not to find the answer to this one.
>
>
>
>    - Chris
>
>
Following the proposals for "Functions that determine the equality of two
sequences or the equality of two arrays" (
https://github.com/qt4cg/qtspecs/issues/99), and the proposals "Functions
that determine if a given sequence starts with another sequence or ends
with another sequence"  (https://github.com/qt4cg/qtspecs/issues/96),  and
"Functions that determine if a given sequence is a subsequence of another
sequence" (https://github.com/qt4cg/qtspecs/issues/94), it seems only
logical to introduce in XPath 4.0 another overload of fn:index-of(), that
accepts as argument a compare() function.

Also, due to its frequent use, we need a standard id-equal() function (the
same as the proposed fn:ops("is")) that will compare two nodes for identity,

Thus, checking if a given node $n belongs to a sequence of nodes $seq (and
using this in scenarios where we want to preserve the original order of
nodes in the sequence) would be as simple as:

exists(index-of($seq, $n, id-equal#2))

Cheers,
Dimitre


>
>    -
>
>
>
>
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/782854> (by
> email <>)
>


-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all
------------------------------------
Quality means doing it right when no one is looking.
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play
-------------------------------------
To achieve the impossible dream, try going to sleep.
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
Typing monkeys will write all Shakespeare's works in 200yrs.Will they write
all patents, too? :)
-------------------------------------
Sanity is madness put to good use.
-------------------------------------
I finally figured out the only reason to be alive is to enjoy it.

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.