xsl-list
[Top] [All Lists]

Re: characters in xsl

2004-11-12 05:42:22

Agreed its logical... but is backwards compatibility mode all that good 
anyway?
 
Even without BC issues it's not clear what a cleaner design would have
been. (There's 1001 ways of seeing a clearer design for XPath2 but this
is rather different).

XPath2 introduced ordered sequences, (they could have been different, eg
allowing nesting, but that would only have made matching issues more
complicated not less) ordered sequences are not as elegant as node sets
(you have to re-assert many of the automatic set properties as ad hoc
rules for each operation, such as de-duplication and sorting into a
cannonical order) however they are clearly often useful. In XSLt1 you
can generated a sorted node list (xsl:for-each/xsl:sort) but it's not a
firt class object you can't save it or do anything with it. In XSLT2
this is no longer the case you can store that sorted list in a variable
and iterate over it as often as you want. this is a good thing on the
whole. However sequences of nodes are not the same thing as being
siblings of some parent (a node can be in any number of sequences but
can only have one parent) just as in XSLT1 a node can be in any number
of node sets but can only have one parent. It's hard to see how they
could have been made the same, and if they are different, then
operations will work differently on the two cases. In particular

axes only apply to nodes in a tree, they never relate to the sequence
that is being operated on.

position() only relates to the sequence that is being operated on, it
never relates to the position of a node in a tree.


Both of the above were equally true in XSLT 1, there are just more
places where the difference shows up in XSLT2 as XSLT2 is a lot more
expressive and the sequences are first class objects.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>