471,354 Members | 2,062 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

xslt for ordering attribute with in a node

Hi ,
I was looking for xslt to rearrang the order of attibutes within a
node.

xml to xml translation...

<obj d="xslt" a="me" c="to" b="new"/>
<prop c="it" b="does" a="how" d="matter"/>

to

<obj a="me" b="new" c="to" d="xslt"/>
<prop a="how" b="does" c="it" d="matter"/>
Thanks alot
Devah

Aug 1 '05 #1
2 1041
Hi,
Tempore 18:01:45, die Monday 01 August 2005 AD, hinc in foro {comp.text.xml} scripsit <gd****@gmail.com>:
I was looking for xslt to rearrang the order of attibutes within a
node. You're out of luck today: that is not possible.
xml to xml translation...

<obj d="xslt" a="me" c="to" b="new"/>
<prop c="it" b="does" a="how" d="matter"/>

to

<obj a="me" b="new" c="to" d="xslt"/>
<prop a="how" b="does" c="it" d="matter"/>

XML parsers don't distinguish between these 2 element pairs. Document order does not apply to attributes. Also, the attributes' order after serialization (that happens when the XSLT magic is done) is not predictable.

regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Deserta faciunt et innovationem appelant
Aug 1 '05 #2
Thanks for quick info. next reader can just write some small script to
do that

Aug 7 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Sergio del Amo | last post: by
1 post views Thread by Johannes Lebek | last post: by
1 post views Thread by Bartek | last post: by
5 posts views Thread by inquirydog | last post: by
1 post views Thread by arnold | last post: by
6 posts views Thread by naima.mans | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.