It depends on what you are going to do; you have to plan a little ahead. Choosing one approach and then later regret it is best avoided ;-) I suggest you make a design first and identify what you really need from the XML arsenal. You only mention the creating and reading of XML data but you probably also want to update and delete parts of the XML documents.

It very much depends on the complexity of your application. What are the required XML features? Do you want to use XPath expressions, apply transformations with XSLT, will you need a validating parser, i.e. are you going to validate your XML documents against some schema (DTD, XMLSchema, RelaxNG, Schematron etc.). What is the expected size of the XML documents etc. etc.

I started out using XML::Simple but soon ran into trouble. It’s only suitable for simple XML stuff (as the name suggests of course!). So for a simple prototype it might be a good choice but don’t expect miracles from it.

As a Windows user my recent experience with XML::LibXML is not too good. In fact I submitted a bug to ActiveState:-( My experience on other platforms is outdated, i.e. 5 years old. At that time some of the standards were only partially implemented which caused us some headaches. I can’t really give a verdict on the current status.

Lately I have been using XML::Twig a lot. However beware, it has a * huge * number of methods and it takes some time to figure out how to use it effectively. A good starting point is http://xmltwig.com/.

Maybe in your situation it is worth considering a proper/native XML database. One of those is eXist. My experience with it is mainly from a Java environment but it seems you can use from Perl as well.

Hope this helps.


In reply to Re: Choosing the best XML module for a toy system by dHarry
in thread Choosing the best XML module for a toy system by fernandes

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.