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


In reply to Re^5: Edit XML through XML Compile by Anonymous Monk
in thread Edit XML through XML Compile by chenino

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.