xslt for ordering attribute with in a node

G

gdevah

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
 
J

Joris Gillis

Hi,
Tempore 18:01:45 said:
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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,001
Messages
2,570,250
Members
46,848
Latest member
Graciela Mitchell

Latest Threads

Top