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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |