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

Re: Using "except" where some nodes are copies (not th

Subject: Re: Using "except" where some nodes are copies (not the original)?
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Wed, 28 Dec 2011 17:02:24 -0800
Re:  Using "except" where some nodes are copies (not th
Anyway, I think that mixing together two kind of identities (node
identity and value identity) is not a safe practice.

My first answer uses value-identity entirely.




On Wed, Dec 28, 2011 at 4:59 PM, Dimitre Novatchev <dnovatchev@xxxxxxxxx>
wrote:
> Perhaps:
>
> (A, B, C)
> B  B  B  B [for $n in .
> B  B  B  B  B  return
> B  B  B  B  B  B  B not( ($B, C)
> B  B  B  B  B  B  B  B  B  B  B  B  [deep-equal(., $n)]
> B  B  B  B  B  B  B  B  B  B )
> B  B  B  B  ]
>
>
>
>
> On Wed, Dec 28, 2011 at 3:17 PM, Costello, Roger L. <costello@xxxxxxxxx>
wrote:
>> Hi Folks,
>>
>> How do I do set subtraction where some of the nodes in the two sets may be
copies (not originals)?
>>
>> Please allow me to explain.
>>
>> Consider this XML document:
>>
>> <Test>
>> B  B <A/>
>> B  B <B/>
>> B  B <C/>
>> </Test>
>>
>> Set <Test> as the context node.
>>
>> This operation:
>>
>> B  B (A, B,, C) except (B, C)
>>
>> returns:
>>
>> B  B (A)
>>
>> Nice.
>>
>> Now, make a copy of B and store it into a variable:
>>
>> B  B  B <xsl:variable name="B" as="element(B)">
>> B  B  B  B  B  B  B  B <xsl:copy-of select="B" />
>> B  B  B  </xsl:variable>
>>
>> Run the same operation, but using the variable:
>>
>> B  B (A, B, C) except ($B, C)
>>
>> Returns:
>>
>> B  B (A, B)
>>
>> Ouch!
>>
>> B I don't want that behavior. I want:
>>
>> B  B (A, B, C) except ($B, C)
>>
>> to return:
>>
>> B  B (A)
>>
>> How do I achieve the behavior I desire?
>>
>> That is, how do I do set subtraction where some of the nodes in the two
sets may be copies?
>>
>> /Roger
>>
>
>
>
> --
> 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
> -------------------------------------
> Facts do not cease to exist because they are ignored.
> -------------------------------------
> I finally figured out the only reason to be alive is to enjoy it.



--
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
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
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.