Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333] : superdoc . print w/replies, xml ) Need Help??

Does anyone know of an XML-parsing module that validates against an XML Schema (XML) file?

I'm using Perl to make a resource compiler for an consumer electronic device. As part of it, certain elements are specified as XML document files. Each type of file has an accompanying XML Schema file (also in XML).

Before I run XML::Parser over them, I want to check that they are valid against their XML Schema. (or does it do that already?)

I had a look at XML::Schema, but if I understand it correctly, I would have to manually go through each Schema and build them up at run-time calling methods. It looks like it is unable to parse an XML Schema in its normal XML form.

Anyone know of a better solution?

Thanks in advance.

Update: I just spotted XML::Validator::Schema

I'm guessing that will have something to do with it. :) Sorry guys.

-Andrew.


In reply to Validating XML against a schema by tomazos

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.