Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > xslt for ordering attribute with in a node

Reply
Thread Tools

xslt for ordering attribute with in a node

 
 
gdevah@gmail.com
Guest
Posts: n/a
 
      08-01-2005
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

 
Reply With Quote
 
 
 
 
Joris Gillis
Guest
Posts: n/a
 
      08-01-2005
Hi,
Tempore 18:01:45, die Monday 01 August 2005 AD, hinc in foro {comp.text.xml} scripsit <(E-Mail Removed)>:

> 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
 
Reply With Quote
 
 
 
 
gdevah@gmail.com
Guest
Posts: n/a
 
      08-07-2005
Thanks for quick info. next reader can just write some small script to
do that

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Z-Ordering (Morton ordering) question nbigaouette C Programming 2 11-06-2009 05:26 AM
[XSLT] Select node by attribute with value from an attribute of its self Stefan_W XML 1 11-05-2008 10:50 AM
xsl variable $node/text() but $node can non-node-set help! Tjerk Wolterink XML 2 08-24-2006 03:28 AM
How to set the node indent property between the parent node and the leaf node viveknatani@gmail.com ASP .Net 0 02-13-2006 07:11 PM
XSLT: branching node processing with respect to node type possible? Ralf Wahner XML 2 07-15-2003 04:18 PM



Advertisments