There's a good chance that although the file itself is well-formed and valid XML that the applications using it are not getting their data from it via names but from the order of the entities. XML::Simple does not maintain the order of entities in the XML it reads and emits -- only the parent-child relationship of the tree is maintained. If you need to deal with a closed-source application that reads XML and cares anything about the ordering of child nodes of a particular parent, you'll need some XML tool that maintains that order.

Various monks will line up for caucus behind XML::Twig, XML::LibXML, XML::XPath, XML::DOM, XML::SAX, and more. Probably the best thing you can do is search the monastery (using super search or using a Yahoo or Google site-specific search perhaps) for XML module information to get the pros and cons of the different modules.

XML::Simple isn't just simple to use, but it's also kept simple in concept by idealizing XML. That's an ideal many packages don't follow, and you'll need a solution that deals better with those additional constraints on certain XML documents. Whether the order of child nodes in an XML document should matter is a deeper and more philosophical issue which won't do much good to argue. Other software developers are putting out code which expects certain nodes in a certain order, and you have to deal with it if you want to produce XML they will properly parse. I would caution you not to take their example if you decide to use XML for your own configuration files, but you're probably not going to change their minds about what's proper for their projects.


In reply to Re: editing .vcproj files using perl. by mr_mischief
in thread editing .vcproj files using perl. by makarand219

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.