gildir,

Interesting question, hard to answer I fear.

Traditionally people attacking an XML problem in Perl, build a single purpose module based on an XML Parser, for example XML::RSS or RPC::XML or SOAP::Lite. The module can deal with all the logic of converting XML into Perl data structures, and converting Perl data structures back to XML. A quick hunt round CPAN will show that there are lots of these modules there already.

An alternative approach is to use Perl to handle the logistics, but let the data stay in XML. For example you can pretty much convert any kind of XML into XHTML or raw text quite easily with XSLT, you don't have to do it programmatically in Perl. As it happens Perl has some good SAX and XSLT technologies to use that are part of AxKit: XML::LibXML, XML::LibXSLT and XML::SAX. You just have to learn SAX or XSLT...

Whatever the reason, unless you have a pressing reason I would not use XML::Parser to base a new module on, the c library it's based on (expat) is getting old, and it does not fully support all the current standards, and it does not support emerging standards. Instead I'd look at XML::LibXML which is very fast and very modern.

Additional resources to look at:

Here:

CPAN:

Elsewhere:

Note: Bits of this post are shamlessly taken from earlier posts by me....


--
ajt

In reply to Re: How to implement XML languages by ajt
in thread How to implement XML languages by gildir

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.