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

RE: Anyone can explain me this syntax?

Subject: RE: Anyone can explain me this syntax?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 13 Jan 2004 13:20:57 -0500
explain me xml
Jaime,

At 02:01 PM 1/13/2004, you wrote:
Thanks Wendell for your complete explanation. While reading your help, I tested another alternative:

ROW[. = key('relacion_x_cobertura', REL_ID)[1]]

and it worked too. The actual XML structure has 35 ROW's, the first 7 ROW's has REL_ID = 1, the following 7 ROW's has REL_ID = 2, and so on (this was a particular case where exist 7 ROW's for each REL_ID).

I think that the new way above worked because all of the ROW's are different (besides REL_ID, the ROW has other fields), and since key('relacion_x_cobertura', REL_ID)[1] returns only 1 node where the key is equal to REL_ID, by comparing . with the key value, returns only 1 ROW, the ROW that allows me to group by REL_ID=1, REL_ID=2, until REL_ID = 5.

I think that case is equivalent to generate-id method since all ROW's has at least 1 field different, making the whole ROW different. Is that true?

Yes, if the *value* of each ROW is unique, it can likewise be used to deduplicate. Note however this is a big IF, and isn't a reliable assumption to make.


To understand this you need to know that $node1 = $node2 is true if the (string) value of $node1 is the same as the string value of $node2 -- and likewise, $nodeset1 = $nodeset2 is true if the value of *any* of the nodes in $nodeset1 is the same as the value of any of the nodes in $nodeset2. This is quite a loose and permissive way of construing node-set equality, which is actually very useful sometimes. But it means that the "=" equality test is not useful for testing node identity unless every node concerned has a unique value -- which is rarely the case.

Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



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.