http://qs321.pair.com?node_id=31109

Item Description: Implements W3C's Document Object Model

Review Synopsis: Good module but the standard interface is really ugly

Description

XML::DOM is a Perl implementation of W3C's DOM Level 1.

It is one of the most widely used Perl XML modules. It is included in libxml-enno

XML::DOM adds some Perl specific features to the W3C recommendation.

Why use XML::DOM?

Why NOT use XML::DOM

Related Modules

Personal notes

I don't like the DOM API at all! I think the model is clean but for some reason the interface is clunky and too verbose. It is extremely Java oriented, from the names of methods to the type of object they return.

That said XML::DOM is a robust module, widely used and well designed. Plus the DOM is generally well documented and some nice tutorials are available.

Warning: there are compatibility problems between various versions of XML::DOM and XML::Parser. The valid combinations are XML::Parser 2.30 + XML::DOM 1.33 and above or XML::Parser 2.30 + XML::DOM 1.29 (included in libxml-enno) or XML-Parser 2.27 (included in Activestate Perl on Windows) + XML::DOM 1.25 (the stand-alone version not included in libxml-enno).

Replies are listed 'Best First'.
RE: XML::DOM
by Anonymous Monk on Oct 25, 2000 at 19:45 UTC
    The warning for using v. 2.27 of XML::Parser was very helpful. I had just developed a system using XML::DOM and was rolling it out with the latest versions, and nothing would work. I knew it probably had something to do with the change to using the external expat libs, but it was a lot of headache debugging. This tip saved be a lot of time today!
      By the way, I have updated XML::DOM to fix some bugs and to work with the lastest version of XML::Parser (2.30). You can download it from here. If you do, let me know if it works!
Re: XML::DOM
by deprecated (Priest) on Feb 25, 2001 at 14:46 UTC
    Please see my fixes for this module's installation process here if youre having problems getting it to work.

    brother dep.

Re: XML::DOM
by mirod (Canon) on Aug 31, 2001 at 20:02 UTC

    I so much hate the DOM API, and I so much like the XML::Twig API ;--), that I have written a quick module to port some of the XML::Twig methods to XML::DOM.

    It is not on CPAN, as I am not sure if it is really a good idea (plus the implementation is kinda crappy at the moment, instead of sub-classing XML::DOM I just pollute its classes with my methods) but you can get it here.

    I think what I am most proud of with this module is the logo...