xsl-list
[Top] [All Lists]

Re: How to sort attribute?

2005-08-13 09:39:19
Hi Kenneth,
  I agree with you completely!

Regards,
Mukul

On 8/13/05, Kenneth Stephen 
<marvin(_dot_)the(_dot_)cynical(_dot_)robot(_at_)gmail(_dot_)com> wrote:
Mukul,

   Err...dont you have that backwards? The spec is clear about the
ordering of attributes - it is unordered and any order that is
imposed, if at all, is implementation defined. So your expectations
are anomalous.

   Not to start a flamewar or anything, but lets remember
semantically speaking, it doesnt make sense for attributes (or
properties, if you want to look at XML with OO-coloured glasses) of
elements (objects) to have order. As Douglas pointed out, if ordering
the data in the attributes makes semantic sense to John's application,
then it makes much more sense to restructure the XML so that the data
in the attributes appears as child elements.

Regards,
Kenneth

On 8/13/05, Mukul Gandhi <gandhi(_dot_)mukul(_at_)gmail(_dot_)com> wrote:
I thought this code should have sorted attribute nodes by names(seems
logical). I tested with Saxon 8.4, and it sorted the attributes by
name.

<xsl:for-each select="@*">
   <xsl:sort select="name()"/>

I remember David Carlisle telling some time back on XSL-List, that XML
Spec is notoriously famous for such anomalies.


--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>