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 use XML::LibXML;
10
11 $dtd = XML::LibXML::Dtd->new($public_id, $system_id);
12 $dtd = XML::LibXML::Dtd->parse_string($dtd_str);
13 $publicId = $dtd->getName();
14 $publicId = $dtd->publicId();
15 $systemId = $dtd->systemId();
16
18 This class holds a DTD. You may parse a DTD from either a string, or
19 from an external SYSTEM identifier.
20
21 No support is available as yet for parsing from a filehandle.
22
23 XML::LibXML::Dtd is a sub-class of XML::LibXML::Node, so all the
24 methods available to nodes (particularly toString()) are available to
25 Dtd objects.
26
28 new
29 $dtd = XML::LibXML::Dtd->new($public_id, $system_id);
30
31 Parse a DTD from the system identifier, and return a DTD object
32 that you can pass to $doc->is_valid() or $doc->validate().
33
34 my $dtd = XML::LibXML::Dtd->new(
35 "SOME // Public / ID / 1.0",
36 "test.dtd"
37 );
38 my $doc = XML::LibXML->new->parse_file("test.xml");
39 $doc->validate($dtd);
40
41 parse_string
42 $dtd = XML::LibXML::Dtd->parse_string($dtd_str);
43
44 The same as new() above, except you can parse a DTD from a string.
45 Note that parsing from string may fail if the DTD contains external
46 parametric-entity references with relative URLs.
47
48 getName
49 $publicId = $dtd->getName();
50
51 Returns the name of DTD; i.e., the name immediately following the
52 DOCTYPE keyword.
53
54 publicId
55 $publicId = $dtd->publicId();
56
57 Returns the public identifier of the external subset.
58
59 systemId
60 $systemId = $dtd->systemId();
61
62 Returns the system identifier of the external subset.
63
65 Matt Sergeant, Christian Glahn, Petr Pajas
66
68 2.0204
69
71 2001-2007, AxKit.com Ltd.
72
73 2002-2006, Christian Glahn.
74
75 2006-2009, Petr Pajas.
76
78 This program is free software; you can redistribute it and/or modify it
79 under the same terms as Perl itself.
80
81
82
83perl v5.30.1 2020-03-18 XML::LibXML::Dtd(3)