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

Re: would like to simplify my XSLT

Subject: Re: would like to simplify my XSLT
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Tue, 30 Jan 2007 16:54:08 +0100
Re:  would like to simplify my XSLT
David Carlisle wrote:
but it's rather more readable to say
key('x','a') intersect key('x','b')

I think I need to practice it a little as soon as I have a use case, to see it in action, so I can *really* understand its use ;)


That woudl get very confusing, especially for text nodes (which many
people use interchangeably with strings). You want it to be clear in the
syntax wheter you are doing identity-equality (so two nodes are ony
equal if they are the same node, or value-equality, where two items are
equal if they have the same string value.

Michael Kay wrote:
You may have noticed that there are example user-written functions to do
value-based union, intersection, and difference of sets of atomic values in
an appendix of the F+O spec.


[...]

Furthermore, (d)
it's not exactly obvious what the spec should be, e.g. ordering of the
result, promotion of numeric types, handling of NaN, etc, especially in
corner cases for example where you have two decimals that are not-equal to
each other but both equal to the same double.
hmm, imo, (d) could've been taken from the description of deep-equal, which defines such equality.

But I agree to both that for clarity there must be a difference between identity equality and value-equality (though clarity was my original reason for broadening the intersect parameter types).

Btw, I find myself often encountering the situation where I have an operation on a sequence of strings and I first have to promote them to text nodes (I usually don't, I just end up using a for-in-return loop). I'll have a look at them to see if that can be done more easily using simpler xpath operators that I often overlook, like David suggests.

Thanks,
-- Abel

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.