Thank you for your quick response ! Please beware that my Perl skills are in need of severe repair, so my responses will reflect that. From looking at your example, I'm trying to figure out how to appropriate the idea of caching a list of schema file content, similar to caching the DTD (or DTDs) from external resources referenced by the URIs within an HTML,XHTML,XML,... After I read the Schema.pod packaged with XML-LibXML-2.0132, it sounded like libxml2's support for handling W3C Schema may not be as mature as the DTDs. I hope I'm very much mistaken.

Let me give you a brief example of the single schema usage (minus the error handling and debug) :

package example; use XML::LibXML; use strict; use warnings; my $xmlFilePath = <local file path>; my $xsdFilePath = <local file path>; my $document = XML::LibXML->load_xml( location => $xmlFilePath ); my $schema = XML::LibXML::Schema->new( location => $xsdFilePath ); $schema->validate( $document );

Simple & short. To extend the above for multiple schemas, and keep the same feel, I'll want to build something that allows the following usage:

: : my $schema = XML::LibXML::Schema->new( location => $xsdFile1Path ); $schema->add( location => $xsdFile2Path ); $schema->add( location => $xsdFile3Path ); : :

Or something similar and grammatically accurate. As long as the library internally has the mechanism to support the dependencies between the schemas themselves, it shouldn't be too complicated to extend XML::LibXML::Schema and take advantage. However, if it were so, I'd imagine the author would have already made an attempt.

Do you still think I'll be successful in reusing your idea to achieve the above ?


In reply to Re^2: Validating an XML file with multiple schemas by mart0000
in thread Validating an XML file with multiple schemas by mart0000

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.