Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / i486-linux-gnu-thread-multi / XML / LibXML / Schema.pod
1 =head1 NAME
2
3 XML::LibXML::Schema - XML Schema Validation
4
5 =head1 SYNOPSIS
6
7
8
9   use XML::LibXML;
10   $doc = XML::LibXML->new->parse_file($url);
11
12   $xmlschema = XML::LibXML::Schema->new( location => $filename_or_url );
13   $xmlschema = XML::LibXML::Schema->new( string => $xmlschemastring );
14   eval { $xmlschema->validate( $doc ); };
15
16 =head1 DESCRIPTION
17
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). 
22
23
24 =head1 METHODS
25
26 =over 4
27
28 =item new
29
30   $xmlschema = XML::LibXML::Schema->new( location => $filename_or_url );
31   $xmlschema = XML::LibXML::Schema->new( string => $xmlschemastring );
32
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
36 source.
37
38 The location parameter allows to parse a schema from the filesystem or a URL.
39
40 The string parameter will parse the schema from the given XML string.
41
42 Note that the constructor will die() if the schema does not meed the
43 constraints of the XML Schema specification.
44
45
46 =item validate
47
48   eval { $xmlschema->validate( $doc ); };
49
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
53 evaluated.
54
55
56
57 =back
58
59 =head1 AUTHORS
60
61 Matt Sergeant, 
62 Christian Glahn, 
63 Petr Pajas
64
65
66 =head1 VERSION
67
68 1.70
69
70 =head1 COPYRIGHT
71
72 2001-2007, AxKit.com Ltd.
73
74 2002-2006, Christian Glahn.
75
76 2006-2009, Petr Pajas.
77
78 =cut