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

All I hear is radio gaga... No wait, make that XPath. Does your code ensure that node ordering is retained? Its a critical concern to me that if I read an XML file in that its elements are written back in exactly the same order. Without order preservation DTD validation is impossible.

Oh and I'm very unhappy about the name ::Smart. It communicates nothing.

  • Comment on Re: XML::Smart - Development in final stage. (beta is out)

Replies are listed 'Best First'.
Re: Re: XML::Smart - Development in final stage. (beta is out)
by gmpassos (Priest) on May 13, 2003 at 15:56 UTC
    Yes, it keeps the order! Note that you actually have a HASH tree inside the object, that have your XML data, exatcly like XML::Simple. When you have multiples nodes, they are inside an array, and if you have a key, and add a new node, this key is converted to an array, with the previous key as the first.

    The only order that is changed is the order of arguments in the tag. What I don't know if can make changes in the use of XML.

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

      Yes, it keeps the order!
      The only order that is changed is the order of arguments in the tag. What I don't know if can make changes in the use of XML.
      I don't know the difference between the two orders you specified. Can you be clearer about which order is kept and which is not? Most likely the only order in question is sibling element order which is what I'm stating is critical and is also what is thrown away by many of the other XML->perl hash translations out there.

        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".