1XML::LibXML::RelaxNG(3)User Contributed Perl DocumentatioXnML::LibXML::RelaxNG(3)
2
3
4
6 XML::LibXML::RelaxNG - RelaxNG Schema Validation
7
9 $rngschema = XML::LibXML::RelaxNG->new( location => $filename_or_url );
10 $rngschema = XML::LibXML::RelaxNG->new( string => $xmlschemastring );
11 $rngschema = XML::LibXML::RelaxNG->new( DOM => $doc );
12 eval { $rngschema->validate( $doc ); };
13
15 The XML::LibXML::RelaxNG class is a tiny frontend to libxml2's RelaxNG
16 implementation. Currently it supports only schema parsing and document
17 validation.
18
19 new
20 $rngschema = XML::LibXML::RelaxNG->new( location => $filename_or_url );
21 $rngschema = XML::LibXML::RelaxNG->new( string => $xmlschemastring );
22 $rngschema = XML::LibXML::RelaxNG->new( DOM => $doc );
23
24 The constructor of XML::LibXML::RelaxNG may get called with either
25 one of three parameters. The parameter tells the class from which
26 source it should generate a validation schema. It is important,
27 that each schema only have a single source.
28
29 The location parameter allows to parse a schema from the filesystem
30 or a URL.
31
32 The string parameter will parse the schema from the given XML
33 string.
34
35 The DOM parameter allows to parse the schema from a preparsed
36 XML::LibXML::Document.
37
38 Note that the constructor will die() if the schema does not meed
39 the constraints of the RelaxNG specification.
40
41 validate
42 eval { $rngschema->validate( $doc ); };
43
44 This function allows to validate a document against the given
45 RelaxNG schema. If this function succeeds, it will return 0, oth‐
46 erwise it will die() and report the errors found. Because of this
47 validate() should be always evaluated.
48
50 Matt Sergeant, Christian Glahn, Petr Pajas,
51
53 1.62
54
56 2001-2006, AxKit.com Ltd; 2002-2006 Christian Glahn; 2006 Petr Pajas,
57 All rights reserved.
58
59
60
61perl v5.8.8 2006-11-17 XML::LibXML::RelaxNG(3)