Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / i486-linux-gnu-thread-multi / XML / LibXML / RelaxNG.pod
1 =head1 NAME
2
3 XML::LibXML::RelaxNG - RelaxNG Schema Validation
4
5 =head1 SYNOPSIS
6
7
8
9   use XML::LibXML;
10   $doc = XML::LibXML->new->parse_file($url);
11
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 ); };
16
17 =head1 DESCRIPTION
18
19 The XML::LibXML::RelaxNG class is a tiny frontend to libxml2's RelaxNG
20 implementation. Currently it supports only schema parsing and document
21 validation.
22
23
24 =head1 METHODS
25
26 =over 4
27
28 =item new
29
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 );
33
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
37 source.
38
39 The location parameter allows to parse a schema from the filesystem or a URL.
40
41 The string parameter will parse the schema from the given XML string.
42
43 The DOM parameter allows to parse the schema from a pre-parsed L<<<<<< XML::LibXML::Document >>>>>>.
44
45 Note that the constructor will die() if the schema does not meed the
46 constraints of the RelaxNG specification.
47
48
49 =item validate
50
51   eval { $rngschema->validate( $doc ); };
52
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.
57
58
59
60 =back
61
62 =head1 AUTHORS
63
64 Matt Sergeant, 
65 Christian Glahn, 
66 Petr Pajas
67
68
69 =head1 VERSION
70
71 1.70
72
73 =head1 COPYRIGHT
74
75 2001-2007, AxKit.com Ltd.
76
77 2002-2006, Christian Glahn.
78
79 2006-2009, Petr Pajas.
80
81 =cut