.\" Automatically generated by Pod::Man 4.14 (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 .. .\" 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 .. .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::Smart::DTD 3pm" .TH XML::Smart::DTD 3pm "2022-11-19" "perl v5.36.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::Smart::DTD \- DTD parser for XML::Smart. .SH "DESCRIPTION" .IX Header "DESCRIPTION" This will parse \s-1DTD\s0 and provides methods to access the information stored in the \s-1DTD.\s0 .SH "USAGE" .IX Header "USAGE" .Vb 1 \& use XML::Smart::DTD ; \& \& my $dtd = XML::Smart::DTD\->new(\*(Aqsome.dtd\*(Aq) ; \& \& if ( $dtd\->child_exists(\*(Aqtag1\*(Aq,\*(Aqsubtag1\*(Aq) ) { \& ... \& } \& \& use Data::Dumper ; \& print Dumper( $dtd\->tree ) ; .Ve .SH "new" .IX Header "new" .SH "METHODS" .IX Header "METHODS" .SS "attr_exists ( \s-1TAG , ATTR\s0 )" .IX Subsection "attr_exists ( TAG , ATTR )" Return \fI\s-1TRUE\s0\fR if the attribute exists in the element \s-1TAG.\s0 .SS "child_exists ( \s-1TAG , CHILD\s0 )" .IX Subsection "child_exists ( TAG , CHILD )" Return \fI\s-1TRUE\s0\fR if the child exists in the element \s-1TAG.\s0 .SS "elem_exists ( \s-1TAG\s0 )" .IX Subsection "elem_exists ( TAG )" Return \fI\s-1TRUE\s0\fR if the element \s-1TAG\s0 exists. .SS "error" .IX Subsection "error" Return the error list. .SS "get_attr_def ( \s-1TAG , ATTR\s0 )" .IX Subsection "get_attr_def ( TAG , ATTR )" Return the default value of an attribute .SS "get_attr_type ( \s-1TAG , ATTR\s0 )" .IX Subsection "get_attr_type ( TAG , ATTR )" Return the attribute type. .SS "get_attr_values ( \s-1TAG , ATTR\s0 )" .IX Subsection "get_attr_values ( TAG , ATTR )" Return the defined values of an attribute. .SS "get_attrs ( \s-1TAG\s0 )" .IX Subsection "get_attrs ( TAG )" Return the attribute list of a element. .SS "get_attrs_req ( \s-1TAG\s0 )" .IX Subsection "get_attrs_req ( TAG )" Return the required attribute list of a element. .SS "get_childs ( \s-1TAG\s0 )" .IX Subsection "get_childs ( TAG )" Return the child list of an element. .SS "get_childs_req ( \s-1TAG\s0 )" .IX Subsection "get_childs_req ( TAG )" Return the required child list of an element. .SS "get_elem_opt ( \s-1TAG\s0 )" .IX Subsection "get_elem_opt ( TAG )" Return the occurrence option of an element: .PP .Vb 4 \& ! REQUIRED AND ONLY ONE MATCH \& + 1 or more \& * 0 or more \& ? 0 or 1 .Ve .SS "get_elem_child_opt ( \s-1TAG , CHILD\s0 )" .IX Subsection "get_elem_child_opt ( TAG , CHILD )" Same of \fI\f(BIget_elem_opt()\fI\fR but this element as a child of an element. .SS "is_attr_fix ( \s-1TAG , ATTR\s0 )" .IX Subsection "is_attr_fix ( TAG , ATTR )" Return \fI\s-1TRUE\s0\fR if an attribute is \fI\s-1FIXED\s0\fR. .SS "is_attr_req ( \s-1TAG , ATTR\s0 )" .IX Subsection "is_attr_req ( TAG , ATTR )" Return \fI\s-1TRUE\s0\fR if an attribute is \fI\s-1REQUIRED\s0\fR. .SS "is_elem_any ( \s-1TAG\s0 )" .IX Subsection "is_elem_any ( TAG )" Return \fI\s-1TRUE\s0\fR if an element is \fI\s-1ANY\s0\fR. .SS "is_elem_child_multi ( \s-1TAG , CHILD\s0 )" .IX Subsection "is_elem_child_multi ( TAG , CHILD )" Return \fI\s-1TRUE\s0\fR if an element can have multiple occurrences as a child of \s-1TAG.\s0 .SS "is_elem_child_opt ( \s-1TAG , CHILD\s0 )" .IX Subsection "is_elem_child_opt ( TAG , CHILD )" Return \fI\s-1TRUE\s0\fR if an element is optional as a child of \s-1TAG.\s0 .SS "is_elem_child_req ( \s-1TAG , CHILD\s0 )" .IX Subsection "is_elem_child_req ( TAG , CHILD )" Return \fI\s-1TRUE\s0\fR if an element is optional as a child of \s-1TAG.\s0 .SS "is_elem_child_uniq ( \s-1TAG , CHILD\s0 )" .IX Subsection "is_elem_child_uniq ( TAG , CHILD )" Return \fI\s-1TRUE\s0\fR if an element is required and unique as a child of \s-1TAG.\s0 .SS "is_elem_pcdata ( \s-1TAG\s0 )" .IX Subsection "is_elem_pcdata ( TAG )" Return \fI\s-1TRUE\s0\fR if an element is \fI\s-1PCDATA\s0\fR (have content). .SS "is_elem_empty ( \s-1TAG\s0 )" .IX Subsection "is_elem_empty ( TAG )" Return \fI\s-1TRUE\s0\fR if an element is \fI\s-1EMPTY\s0\fR (doesn't have attributes, content or children). .SS "is_elem_multi ( \s-1TAG\s0 )" .IX Subsection "is_elem_multi ( TAG )" Return \fI\s-1TRUE\s0\fR if an element can have multiple occurrences globally. .SS "is_elem_opt ( \s-1TAG\s0 )" .IX Subsection "is_elem_opt ( TAG )" Return \fI\s-1TRUE\s0\fR if an element is optional globally. .ie n .SS "is_elem_parent ( \s-1TAG ,\s0 @PARENTS )" .el .SS "is_elem_parent ( \s-1TAG ,\s0 \f(CW@PARENTS\fP )" .IX Subsection "is_elem_parent ( TAG , @PARENTS )" Return \fI\s-1TRUE\s0\fR if the list of \f(CW@PARENTS\fR can be parent of element \s-1TAG.\s0 .SS "is_elem_req" .IX Subsection "is_elem_req" Return \fI\s-1TRUE\s0\fR if an element is required globally. .SS "is_elem_uniq" .IX Subsection "is_elem_uniq" Return \fI\s-1TRUE\s0\fR if an element is unique and required globally. .SS "root" .IX Subsection "root" Return the root name of the \s-1DTD.\s0 .SS "tree" .IX Subsection "tree" Return the \s-1HASH\s0 tree of the \s-1DTD.\s0 .SH "SEE ALSO" .IX Header "SEE ALSO" XML::Smart, XML::DTDParser. .SH "AUTHOR" .IX Header "AUTHOR" Graciliano M. P. .PP I will appreciate any type of feedback (include your opinions and/or suggestions). ;\-P .SH "THANKS" .IX Header "THANKS" Thanks to Jenda@Krynicky.cz http://Jenda.Krynicky.cz that is the author of XML::DTDParser. .SH "COPYRIGHT" .IX Header "COPYRIGHT" The \s-1DTD\s0 parser was based on XML\-DTDParser\-1.7 by Jenda@Krynicky.cz http://Jenda.Krynicky.cz .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.