.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "XML::LibXML::Dtd 3pm" .TH XML::LibXML::Dtd 3pm "2017-10-29" "perl v5.26.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 \s-1DTD.\s0 You may parse a \s-1DTD\s0 from either a string, or from an external \s-1SYSTEM\s0 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 \fItoString()\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 \s-1DTD\s0 from the system identifier, and return a \s-1DTD\s0 object that you can pass to \f(CW$doc\fR\->\fIis_valid()\fR or \f(CW$doc\fR\->\fIvalidate()\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 \fInew()\fR above, except you can parse a \s-1DTD\s0 from a string. Note that parsing from string may fail if the \s-1DTD\s0 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 \s-1DTD\s0; i.e., the name immediately following the \s-1DOCTYPE\s0 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.0128 .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.