in reply to Re: Re: Re: XML::Smart - Development in final stage. (beta is out)
in thread XML::Smart - Development in final stage. (beta is out)

If you have this in the original XML:
<foo cc="1" bb="2" aa="3"/>
When you rewrie the XML you got:
<foo aa="3" bb="2" cc="1"/>
This hapens because the keys in the hash doesn't have order, soo I sort it.

But if you have:

<foo> <i>zzz</i> <i>xxx</i> <i>www</i> </foo>
The order of the multiple 'i' isn't changed.

What I don't know is if the 1st type, where the order is changed, make difference in the DTD, since I'm not a XML geek. If the order for the arguments in the tag is really needed, I can make XML::Smart care with the order of the keys, but this will consume more memory and CPU.

Graciliano M. P.
"The creativity is the expression of the liberty".

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: XML::Smart - Development in final stage. (beta is out)
by diotalevi (Canon) on May 13, 2003 at 20:55 UTC

    I'm not aware of attribute order ever being a concern. Element order always is so in the following code, you must always reconstruct it in this order. The two identically named elements may remain in order though DTD doesn't require it. The other sibling elements D and C must remain in exactly that order - perl's hash order cannot be allowed to disturb that. All in all, I think you'll find that Tie::HashIx is useful for this. If you don't intend on producing validatable XML then this requirement isn't important - your call.

    <a> <d>e</d> <b>a</b> <b>b</b> <c>c</c> </a>