xsl-list
[Top] [All Lists]

RE: How to sort attribute?

2005-08-15 01:09:32
Thanks for the explanation. That sounds a pretty good reason. If the system
did provide support for this requirement, it would be in the serialization
options. Unfortunately, though, neither the 1.0 or 2.0 serialization specs
give you any control over this, or over other aspects specified in XML
canonicalisation specs, such as the choice of quotation marks around
attribute values or whitespace characters within start tags. I'd suggest you
consider writing your own serializer: most Java-based XSLT processors allow
you to do this.

Michael Kay
http://www.saxonica.com/

-----Original Message-----
From: John Li [mailto:johnli121(_at_)163(_dot_)com] 
Sent: 15 August 2005 03:23
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] How to sort attribute?

Hi Michael,

I implement a parser of one XML related spec. In it, it 
defines the  format
of output file clearly.

"... ... is canonical in the sense that within each child 
element of the
root, the attributes are sorted lexicographically, and then 
those elements
are sorted lexicographically with respect to the element 
names and attribute
values."

If xerces or xalan cannot do it, that will be a big trouble for me.

Thanks,
John

-----Original Message-----
From: 
xsl-list-return-19570-johnli121=163(_dot_)com(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:xsl-list-return-19570-johnli121=163(_dot_)com(_at_)lists(_dot_)mulberry
tech.com] On
Behalf Of Michael Kay
Sent: Monday, August 15, 2005 5:14 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] How to sort attribute?

I cannot accept to transform attribute to element. What I 
want is sort 
the attribute lexicographic.

It would be interesting to know *why* you want to do this.

Is it just for the comfort and convenience of the human reader (an
acceptable reason, though I fear you will be disappointed), 
or is it because
you are sending the XML to a software application that requires the
attributes to be in a particular order (an unacceptable reason)?

Michael Kay
http://www.saxonica.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>
--~--




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