http://qs1969.pair.com?node_id=721194

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

Oh Monks,

I'm seeking the wisdom of the ages... which of the many paths is the best for me?

I simply need a validation step after generating an XML string in perl. The code currently pipes the string out to "java dom.DOMCount -v" to do this.

Should I compile my own http://xerces.apache.org/xerces-p/ Or the (seemingly old and totally undocumented) http://search.cpan.org/dist/XML-Xerces/? Or shell out to the C version of Xerces? Or libxml-checker-perl? Or?

I'd prefer something I can install from a Debian package on Etch. Is there anything that's prepackaged? It seems the C version of Xerces requires hand compiling utilities like DOMCount. And XML-Xerces is like 20 lines of code just to validate -- and you ahve to read the C documentation, which does not quite line up with the perl reality.

Or put another way: given a $xml string in perl, how can I validate it as XML?