in reply to How to check xml elements?
For some reason, this is not documented in the POD (which is why almost no one knows about XML:LibXML's schema validation powers!), but the XML::LibXML source comes with the documentation in docbook format plus a utility to generate the POD from that.use XML::LibXML; my $schema_file = 'po.xsd'; my $document = 'po.xml'; my $schema = XML::LibXML::Schema->new(location => $schema_file); my $parser = XML::LibXML->new; my $doc = $parser->parse_file($document); eval { $schema->validate($doc) }; die $@ if $@; print "$document validated successfully\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to check xml elements?
by gube (Parson) on Jan 09, 2006 at 10:47 UTC | |
by astroboy (Chaplain) on Jan 10, 2006 at 08:48 UTC |