Validating xml with perl


The code currently pipes the string out to "java dom. Should I compile my own Or the (seemingly old and totally undocumented) Or put another way: given a $xml string in perl, how can I validate it as XML? Of immediate interest may be XML:: Twig, XML:: Parser or XML:: Lib XML for validating XML documents.

I simply need a validation step after generating an XML string in perl. 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. There are a large number of Perl modules available for working with XML.

validating xml with perl-86validating xml with perl-71

NET framework, this is also available for mono if you are not on Windows and the mono implementation is described here.

Errors in XML documents will stop your XML applications.

The W3C XML specification states that a program should stop processing an XML document if it finds an error.

I think you are talking in part about "XML Schema Inference", that is generating an XSD schema from an existing instance of XML.

As far as I know there is no module on CPAN that provides this facility (though I would be delighted to be proved wrong.) The basic problem of schema inference (or extraction if you would rather) is described in this paper.

That's where the very useful Perl module called XML:: Simple comes in.

You must have an account to comment. Please register or login here!