perl: xml to object and back exactly
Is there any XML to object converter that can convert back again, which ensures the files are exact duplicates? I can't see to find any on CPAN that ensure the files can go in and out exactally as they are made.
This is not possible in any language, as XML has variant ways of representing the same data.
Textual data containing xml entities can be represented either by escaping the entities or by wrapping stuff in CDATA sections.
Empty tags can be represented as either <tag/> or <tag></tag>.
And some whitespace is insignificant and may be altered.
As multiple textual xml representations can represent the same DOM structure, it's impossible to guarantee reading xml text into DOM, writing it out again and getting exactly the same.