It is hard to choose some tool, because you never know all formats which you have to process... It is my experience of very similar situation.

The crucial question is "How to implement my logic on various, mostly unpredictable data structures?". I think that XML::Simple is good for the simplest examples. It needs some experience with that tools, but consider XML::Twig, XML::Rules, tools performing xslt transformation or more generally, using XPath lang, iterating DOM structure, iterating object structure of XML::Trivial (my kid :) or, for instance, more esoteric STX language, http://stx.sourceforge.net/ .

Principially, you can spare some work using some "scripting" language, which is oriented for xml processing (xslt, stx, xpath), but you can loose some power. And oppositely using Perl, iterating through Perl data/object representation of the document.

Another problem could be processing of huge documents. In this case XML::Twig or stx can work for you, but consider raw processing of some XML::Parser output too.


In reply to Re: The best way to handle different type of XML files by pajout
in thread The best way to handle different type of XML files by mahira

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.