I've worked with XML a fair amount and written some Schemas myself, but it seems I hadn't come across something as (seemingly) complex as you're describing :-) Anyway, there are of course other modules you could try out and see if they work for you, I just don't have any experience with them. Other than that, if you do end up having to go the route of calling an external validator, then my module IPC::Run3::Shell might be of interest. Here's an example I adapted from one of my older projects where I call an external xmllint (this was before I had figured out the above solution using XML::LibXML):
use IPC::Run3::Shell ':FATAL', [ xmllint => qw/ xmllint --noout --nonet --path /, $external_schemas_path, '--schema']; my $pass = eval { xmllint($schema, $file); $?==0 }; print $file, ": ", $pass ? "PASS" : "FAIL", "\n";
The module also offers ways to capture STDOUT and STDERR if you want to suppress and/or inspect that.
If the external validator is Java, then I've played around with Inline::Java, and it seems to work ok too.
In reply to Re^7: Validating an XML file with multiple schemas
by haukex
in thread Validating an XML file with multiple schemas
by mart0000
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |