.\" -*- 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::Smart::DTD 3" .TH XML::Smart::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::Smart::DTD \- DTD parser for XML::Smart. .SH DESCRIPTION .IX Header "DESCRIPTION" This will parse DTD and provides methods to access the information stored in the DTD. .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 ( TAG , ATTR )" .IX Subsection "attr_exists ( TAG , ATTR )" Return \fITRUE\fR if the attribute exists in the element TAG. .SS "child_exists ( TAG , CHILD )" .IX Subsection "child_exists ( TAG , CHILD )" Return \fITRUE\fR if the child exists in the element TAG. .SS "elem_exists ( TAG )" .IX Subsection "elem_exists ( TAG )" Return \fITRUE\fR if the element TAG exists. .SS error .IX Subsection "error" Return the error list. .SS "get_attr_def ( TAG , ATTR )" .IX Subsection "get_attr_def ( TAG , ATTR )" Return the default value of an attribute .SS "get_attr_type ( TAG , ATTR )" .IX Subsection "get_attr_type ( TAG , ATTR )" Return the attribute type. .SS "get_attr_values ( TAG , ATTR )" .IX Subsection "get_attr_values ( TAG , ATTR )" Return the defined values of an attribute. .SS "get_attrs ( TAG )" .IX Subsection "get_attrs ( TAG )" Return the attribute list of a element. .SS "get_attrs_req ( TAG )" .IX Subsection "get_attrs_req ( TAG )" Return the required attribute list of a element. .SS "get_childs ( TAG )" .IX Subsection "get_childs ( TAG )" Return the child list of an element. .SS "get_childs_req ( TAG )" .IX Subsection "get_childs_req ( TAG )" Return the required child list of an element. .SS "get_elem_opt ( TAG )" .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 ( TAG , CHILD )" .IX Subsection "get_elem_child_opt ( TAG , CHILD )" Same of \fR\f(BIget_elem_opt()\fR\fI\fR but this element as a child of an element. .SS "is_attr_fix ( TAG , ATTR )" .IX Subsection "is_attr_fix ( TAG , ATTR )" Return \fITRUE\fR if an attribute is \fIFIXED\fR. .SS "is_attr_req ( TAG , ATTR )" .IX Subsection "is_attr_req ( TAG , ATTR )" Return \fITRUE\fR if an attribute is \fIREQUIRED\fR. .SS "is_elem_any ( TAG )" .IX Subsection "is_elem_any ( TAG )" Return \fITRUE\fR if an element is \fIANY\fR. .SS "is_elem_child_multi ( TAG , CHILD )" .IX Subsection "is_elem_child_multi ( TAG , CHILD )" Return \fITRUE\fR if an element can have multiple occurrences as a child of TAG. .SS "is_elem_child_opt ( TAG , CHILD )" .IX Subsection "is_elem_child_opt ( TAG , CHILD )" Return \fITRUE\fR if an element is optional as a child of TAG. .SS "is_elem_child_req ( TAG , CHILD )" .IX Subsection "is_elem_child_req ( TAG , CHILD )" Return \fITRUE\fR if an element is optional as a child of TAG. .SS "is_elem_child_uniq ( TAG , CHILD )" .IX Subsection "is_elem_child_uniq ( TAG , CHILD )" Return \fITRUE\fR if an element is required and unique as a child of TAG. .SS "is_elem_pcdata ( TAG )" .IX Subsection "is_elem_pcdata ( TAG )" Return \fITRUE\fR if an element is \fIPCDATA\fR (have content). .SS "is_elem_empty ( TAG )" .IX Subsection "is_elem_empty ( TAG )" Return \fITRUE\fR if an element is \fIEMPTY\fR (doesn't have attributes, content or children). .SS "is_elem_multi ( TAG )" .IX Subsection "is_elem_multi ( TAG )" Return \fITRUE\fR if an element can have multiple occurrences globally. .SS "is_elem_opt ( TAG )" .IX Subsection "is_elem_opt ( TAG )" Return \fITRUE\fR if an element is optional globally. .ie n .SS "is_elem_parent ( TAG , @PARENTS )" .el .SS "is_elem_parent ( TAG , \f(CW@PARENTS\fP )" .IX Subsection "is_elem_parent ( TAG , @PARENTS )" Return \fITRUE\fR if the list of \f(CW@PARENTS\fR can be parent of element TAG. .SS is_elem_req .IX Subsection "is_elem_req" Return \fITRUE\fR if an element is required globally. .SS is_elem_uniq .IX Subsection "is_elem_uniq" Return \fITRUE\fR if an element is unique and required globally. .SS root .IX Subsection "root" Return the root name of the DTD. .SS tree .IX Subsection "tree" Return the HASH tree of the DTD. .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 DTD 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.