1XML::Smart::DTD(3)    User Contributed Perl Documentation   XML::Smart::DTD(3)
2
3
4

NAME

6       XML::Smart::DTD - DTD parser for XML::Smart.
7

DESCRIPTION

9       This will parse DTD and provides methods to access the information
10       stored in the DTD.
11

USAGE

13         use XML::Smart::DTD ;
14
15         my $dtd = XML::Smart::DTD->new('some.dtd') ;
16
17         if ( $dtd->child_exists('tag1','subtag1') ) {
18         ...
19         }
20
21         use Data::Dumper ;
22         print Dumper( $dtd->tree ) ;
23

new

METHODS

26   attr_exists ( TAG , ATTR )
27       Return TRUE if the attribute exists in the element TAG.
28
29   child_exists ( TAG , CHILD )
30       Return TRUE if the child exists in the element TAG.
31
32   elem_exists ( TAG )
33       Return TRUE if the element TAG exists.
34
35   error
36       Return the error list.
37
38   get_attr_def ( TAG , ATTR )
39       Return the default value of an attribute
40
41   get_attr_type ( TAG , ATTR )
42       Return the attribute type.
43
44   get_attr_values ( TAG , ATTR )
45       Return the defined values of an attribute.
46
47   get_attrs ( TAG )
48       Return the attribute list of a element.
49
50   get_attrs_req ( TAG )
51       Return the required attribute list of a element.
52
53   get_childs ( TAG )
54       Return the child list of an element.
55
56   get_childs_req ( TAG )
57       Return the required child list of an element.
58
59   get_elem_opt ( TAG )
60       Return the occurrence option of an element:
61
62         !  REQUIRED AND ONLY ONE MATCH
63         +  1 or more
64         *  0 or more
65         ?  0 or 1
66
67   get_elem_child_opt ( TAG , CHILD )
68       Same of get_elem_opt() but this element as a child of an element.
69
70   is_attr_fix ( TAG , ATTR )
71       Return TRUE if an attribute is FIXED.
72
73   is_attr_req ( TAG , ATTR )
74       Return TRUE if an attribute is REQUIRED.
75
76   is_elem_any ( TAG )
77       Return TRUE if an element is ANY.
78
79   is_elem_child_multi ( TAG , CHILD )
80       Return TRUE if an element can have multiple occurrences as a child of
81       TAG.
82
83   is_elem_child_opt ( TAG , CHILD )
84       Return TRUE if an element is optional as a child of TAG.
85
86   is_elem_child_req ( TAG , CHILD )
87       Return TRUE if an element is optional as a child of TAG.
88
89   is_elem_child_uniq ( TAG , CHILD )
90       Return TRUE if an element is required and unique as a child of TAG.
91
92   is_elem_pcdata ( TAG )
93       Return TRUE if an element is PCDATA (have content).
94
95   is_elem_empty ( TAG )
96       Return TRUE if an element is EMPTY (doesn't have attributes, content or
97       children).
98
99   is_elem_multi ( TAG )
100       Return TRUE if an element can have multiple occurrences globally.
101
102   is_elem_opt ( TAG )
103       Return TRUE if an element is optional globally.
104
105   is_elem_parent ( TAG , @PARENTS )
106       Return TRUE if the list of @PARENTS can be parent of element TAG.
107
108   is_elem_req
109       Return TRUE if an element is required globally.
110
111   is_elem_uniq
112       Return TRUE if an element is unique and required globally.
113
114   root
115       Return the root name of the DTD.
116
117   tree
118       Return the HASH tree of the DTD.
119

SEE ALSO

121       XML::Smart, XML::DTDParser.
122

AUTHOR

124       Graciliano M. P. <gm@virtuasites.com.br>
125
126       I will appreciate any type of feedback (include your opinions and/or
127       suggestions). ;-P
128

THANKS

130       Thanks to Jenda@Krynicky.cz http://Jenda.Krynicky.cz that is the author
131       of XML::DTDParser.
132
134       The DTD parser was based on XML-DTDParser-1.7 by Jenda@Krynicky.cz
135       http://Jenda.Krynicky.cz
136
137       This program is free software; you can redistribute it and/or modify it
138       under the same terms as Perl itself.
139
140
141
142perl v5.38.0                      2023-07-21                XML::Smart::DTD(3)
Impressum