.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "XML::LibXML::Dtd 3" .TH XML::LibXML::Dtd 3 2023-07-25 "perl v5.38.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME XML::LibXML::Dtd \- XML::LibXML DTD Handling .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use XML::LibXML; \& \& $dtd = XML::LibXML::Dtd\->new($public_id, $system_id); \& $dtd = XML::LibXML::Dtd\->parse_string($dtd_str); \& $publicId = $dtd\->getName(); \& $publicId = $dtd\->publicId(); \& $systemId = $dtd\->systemId(); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This class holds a DTD. You may parse a DTD from either a string, or from an external SYSTEM identifier. .PP No support is available as yet for parsing from a filehandle. .PP XML::LibXML::Dtd is a sub-class of XML::LibXML::Node, so all the methods available to nodes (particularly \fBtoString()\fR) are available to Dtd objects. .SH METHODS .IX Header "METHODS" .IP new 4 .IX Item "new" .Vb 1 \& $dtd = XML::LibXML::Dtd\->new($public_id, $system_id); .Ve .Sp Parse a DTD from the system identifier, and return a DTD object that you can pass to \f(CW$doc\fR\->\fBis_valid()\fR or \f(CW$doc\fR\->\fBvalidate()\fR. .Sp .Vb 6 \& my $dtd = XML::LibXML::Dtd\->new( \& "SOME // Public / ID / 1.0", \& "test.dtd" \& ); \& my $doc = XML::LibXML\->new\->parse_file("test.xml"); \& $doc\->validate($dtd); .Ve .IP parse_string 4 .IX Item "parse_string" .Vb 1 \& $dtd = XML::LibXML::Dtd\->parse_string($dtd_str); .Ve .Sp The same as \fBnew()\fR above, except you can parse a DTD from a string. Note that parsing from string may fail if the DTD contains external parametric-entity references with relative URLs. .IP getName 4 .IX Item "getName" .Vb 1 \& $publicId = $dtd\->getName(); .Ve .Sp Returns the name of DTD; i.e., the name immediately following the DOCTYPE keyword. .IP publicId 4 .IX Item "publicId" .Vb 1 \& $publicId = $dtd\->publicId(); .Ve .Sp Returns the public identifier of the external subset. .IP systemId 4 .IX Item "systemId" .Vb 1 \& $systemId = $dtd\->systemId(); .Ve .Sp Returns the system identifier of the external subset. .SH AUTHORS .IX Header "AUTHORS" Matt Sergeant, Christian Glahn, Petr Pajas .SH VERSION .IX Header "VERSION" 2.0209 .SH COPYRIGHT .IX Header "COPYRIGHT" 2001\-2007, AxKit.com Ltd. .PP 2002\-2006, Christian Glahn. .PP 2006\-2009, Petr Pajas. .SH LICENSE .IX Header "LICENSE" This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.