3 XML::LibXML::RelaxNG - RelaxNG Schema Validation
10 $doc = XML::LibXML->new->parse_file($url);
12 $rngschema = XML::LibXML::RelaxNG->new( location => $filename_or_url );
13 $rngschema = XML::LibXML::RelaxNG->new( string => $xmlschemastring );
14 $rngschema = XML::LibXML::RelaxNG->new( DOM => $doc );
15 eval { $rngschema->validate( $doc ); };
19 The XML::LibXML::RelaxNG class is a tiny frontend to libxml2's RelaxNG
20 implementation. Currently it supports only schema parsing and document
30 $rngschema = XML::LibXML::RelaxNG->new( location => $filename_or_url );
31 $rngschema = XML::LibXML::RelaxNG->new( string => $xmlschemastring );
32 $rngschema = XML::LibXML::RelaxNG->new( DOM => $doc );
34 The constructor of XML::LibXML::RelaxNG may get called with either one of three
35 parameters. The parameter tells the class from which source it should generate
36 a validation schema. It is important, that each schema only have a single
39 The location parameter allows to parse a schema from the filesystem or a URL.
41 The string parameter will parse the schema from the given XML string.
43 The DOM parameter allows to parse the schema from a pre-parsed L<<<<<< XML::LibXML::Document >>>>>>.
45 Note that the constructor will die() if the schema does not meed the
46 constraints of the RelaxNG specification.
51 eval { $rngschema->validate( $doc ); };
53 This function allows to validate a (parsed) document against the given RelaxNG
54 schema. The argument of this function should be a XML::LibXML::Document object.
55 If this function succeeds, it will return 0, otherwise it will die() and report
56 the errors found. Because of this validate() should be always evaluated.
75 2001-2007, AxKit.com Ltd.
77 2002-2006, Christian Glahn.
79 2006-2009, Petr Pajas.