in reply to Re^4: Edit XML through XML Compile
in thread Edit XML through XML Compile
Unfortunately, i haven't got XML::Compiler::Cache for use.
I don't think you need XML::Compile::Cache to use XML::Compile.
In the section about writing, he explains how to insert a node in an existing file, DWIM style.
I think you may have misunderstood this in the article - he doesn't actually explain how to insert a node in an existing file; as far as I can tell the "DWIM" refers to the translation of the Perl data structure back to XML, not some other method of manipulating nodes. That is how XML::Compile works - it translates between XML and Perl data structures, applying all sorts of checks to make sure the translation is clean and the XML is valid.
Thats what i want to do, as working in the hashes seems to unreliable for me.
Not sure what you mean by "unreliable" - XML::Compile will translate your Perl data structure back to XML as cleanly as it can, and it guarantees to write valid XML. It seems like you're more worried about working with the hashes than you need to be...
So my question was about if there is any way to to it in this style but with only the modules given in my first post and without Messing aroung within the hashes. Even if there would be an easy way to get my XML File into an LibXML-Document and search for parents and add children in this would be enough for me, i think. Thas why i was asking for if there is any possibility in XML Compile to edit items in a style like in LibXML::Documents or XML:Twig
If you really don't want to work with the Perl data structures, then an alternative is to work with XML::LibXML directly, since you've already got that, and not use XML::Compile at all. For example, here is a tutorial.
(Disclaimer: I haven't worked with XML::Compile extensively so some of the above is based on my understanding of the docs.)
|
|---|