3 XML::LibXML::Schema - XML Schema Validation
10 $doc = XML::LibXML->new->parse_file($url);
12 $xmlschema = XML::LibXML::Schema->new( location => $filename_or_url );
13 $xmlschema = XML::LibXML::Schema->new( string => $xmlschemastring );
14 eval { $xmlschema->validate( $doc ); };
18 The XML::LibXML::Schema class is a tiny frontend to libxml2's XML Schema
19 implementation. Currently it supports only schema parsing and document
20 validation. As of 2.6.32, libxml2 only supports decimal types up to 24 digits
21 (the standard requires at least 18).
30 $xmlschema = XML::LibXML::Schema->new( location => $filename_or_url );
31 $xmlschema = XML::LibXML::Schema->new( string => $xmlschemastring );
33 The constructor of XML::LibXML::Schema may get called with either one of two
34 parameters. The parameter tells the class from which source it should generate
35 a validation schema. It is important, that each schema only have a single
38 The location parameter allows to parse a schema from the filesystem or a URL.
40 The string parameter will parse the schema from the given XML string.
42 Note that the constructor will die() if the schema does not meed the
43 constraints of the XML Schema specification.
48 eval { $xmlschema->validate( $doc ); };
50 This function allows to validate a (parsed) document against the given XML
51 Schema. The argument of this function should be a L<<<<<< XML::LibXML::Document >>>>>> object. If this function succeeds, it will return 0, otherwise it will die()
52 and report the errors found. Because of this validate() should be always
72 2001-2007, AxKit.com Ltd.
74 2002-2006, Christian Glahn.
76 2006-2009, Petr Pajas.