Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I've been using XML::Parser and XML::Parser::Expat for a while, and they work well enough. I've been searching CPAN though, and I can't find anything that either builds DOM trees or does validation of XML files against a DTD. In the past, because I needed that, and because I was writing in perl, I've been forced to come up with some ad-hoc nasty solutions for validation of XML using XML::Parser. Basically, it doesn't follow a DTD per se, but it keeps tags that are open on a stack and uses the nesting information given by the stack to issue warnings, errors, and build data structures and so on. The question is this; am I missing something or is there a CPAN module to do DOM/validation? If not, does anybody know of a project currently under way to meet those needs? I've got some experience in that area, and I'd like to help out if something is coming into existence, but I don't feel like reinventing the wheel if it already does somewhere. Any help would be greatly appreciated. Smartass flames, (which I have heard are an off-and-on problem here at perlmonks, which I am new to) >/dev/null. Because after all, in /dev/null, no one can hear you stream.

Replies are listed 'Best First'.
Re: XML things
by gnat (Beadle) on Aug 30, 2000 at 21:46 UTC
    XML::DOM is what you want. I also heard talk on the perl-xml list this week about a new module (probably by Matt Sargeant :-) that's a wrapper for XML::DOM so that it behaves more Perlishly. Nat
Re: XML things
by mirod (Canon) on Aug 30, 2000 at 21:22 UTC

    Have you checked XML::Checker ? It's in libxml-enno. It checks XML against the DTD, it does not work on DOM trees as far as I know.

    Sorry, can't think of any flame right now ;--)

Re: XML things
by agoth (Chaplain) on Aug 30, 2000 at 22:48 UTC