1XML::LibXML::Dtd(3) User Contributed Perl Documentation XML::LibXML::Dtd(3)
2
3
4
6 XML::LibXML::Dtd - XML::LibXML DTD Handling
7
9 $dtd = XML::LibXML::Dtd->new($public_id, $system_id);
10 $dtd = XML::LibXML::Dtd->parse_string($dtd_str);
11 $publicId = $dtd->getName();
12 $publicId = $dtd->publicId();
13 $systemId = $dtd->systemId();
14
16 This class holds a DTD. You may parse a DTD from either a string, or
17 from an external SYSTEM identifier.
18
19 No support is available as yet for parsing from a filehandle.
20
21 XML::LibXML::Dtd is a sub-class of Node, so all the methods available
22 to nodes (particularly toString()) are available to Dtd objects.
23
24 new
25 $dtd = XML::LibXML::Dtd->new($public_id, $system_id);
26
27 Parse a DTD from the system identifier, and return a DTD object
28 that you can pass to $doc->is_valid() or $doc->validate().
29
30 my $dtd = XML::LibXML::Dtd->new(
31 "SOME // Public / ID / 1.0",
32 "test.dtd"
33 );
34 my $doc = XML::LibXML->new->parse_file("test.xml");
35 $doc->validate($dtd);
36
37 parse_string
38 $dtd = XML::LibXML::Dtd->parse_string($dtd_str);
39
40 The same as new() above, except you can parse a DTD from a string.
41 Note that parsing from string may fail if the DTD contains external
42 parametric-entity references with relative URLs.
43
44 getName
45 $publicId = $dtd->getName();
46
47 Returns the name of DTD; i.e., the name immediately following the
48 DOCTYPE keyword.
49
50 publicId
51 $publicId = $dtd->publicId();
52
53 Returns the public identifier of the external subset.
54
55 systemId
56 $systemId = $dtd->systemId();
57
58 Returns the system identifier of the external subset.
59
61 Matt Sergeant, Christian Glahn, Petr Pajas,
62
64 1.62
65
67 2001-2006, AxKit.com Ltd; 2002-2006 Christian Glahn; 2006 Petr Pajas,
68 All rights reserved.
69
70
71
72perl v5.8.8 2006-11-17 XML::LibXML::Dtd(3)