.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" 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 turned on, 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 .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "XML::Smart::DTD 3pm" .TH XML::Smart::DTD 3pm "2013-01-29" "perl v5.20.1" "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\fIget_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.