XML::Smart::DTD(3pm)
π NAME π
Hey bestie, welcome to XML::Smart::DTD(3pm) from the User Contributed Perl Documentation. She's a DTD parser for XML::Smart, and this page is literally all about her. π
XML::Smart::DTD β DTD parser for XML::Smart.
β¨ DESCRIPTION β¨
Okay so this parses DTD and gives you methods to access the info stored in the DTD. That's the whole serve. Periodt. β¨
πΈ USAGE πΈ
use XML::Smart::DTD ;
my $dtd = XML::Smart::DTD->new('some.dtd') ;
if ( $dtd->child_exists('tag1','subtag1') ) {
...
}
use Data::Dumper ;
print Dumper( $dtd->tree ) ;
π± new π±
The page just drops new here, so we're keeping it exactly like that. No extra lore, bestie. π«Ά
π METHODS π
π attr_exists ( TAG , ATTR ) π
Returns TRUE if the attribute exists in the element TAG. Slay.
π child_exists ( TAG , CHILD ) π
Returns TRUE if the child exists in the element TAG.
π elem_exists ( TAG ) π
Returns TRUE if the element TAG exists.
π error π
Returns the error list. Errors, but make it accessible.
π get_attr_def ( TAG , ATTR ) π
Returns the default value of an attribute.
π get_attr_type ( TAG , ATTR ) π
Returns the attribute type.
π get_attr_values ( TAG , ATTR ) π
Returns the defined values of an attribute.
π get_attrs ( TAG ) π
Returns the attribute list of an element.
π get_attrs_req ( TAG ) π
Returns the required attribute list of an element.
π get_childs ( TAG ) π
Returns the child list of an element.
π get_childs_req ( TAG ) π
Returns the required child list of an element.
π get_elem_opt ( TAG ) π
Returns the occurrence option of an element:
! REQUIRED AND ONLY ONE MATCH
+ 1 or more
* 0 or more
? 0 or 1
π get_elem_child_opt ( TAG , CHILD ) π
Same as get_elem_opt(), but for this element as a child of an element. iykyk.
π is_attr_fix ( TAG , ATTR ) π
Returns TRUE if an attribute is FIXED.
π is_attr_req ( TAG , ATTR ) π
Returns TRUE if an attribute is REQUIRED.
π is_elem_any ( TAG ) π
Returns TRUE if an element is ANY.
π is_elem_child_multi ( TAG , CHILD ) π
Returns TRUE if an element can have multiple occurrences as a child of TAG.
π is_elem_child_opt ( TAG , CHILD ) π
Returns TRUE if an element is optional as a child of TAG.
π is_elem_child_req ( TAG , CHILD ) π
Returns TRUE if an element is optional as a child of TAG.
β οΈ Heads up: the page literally says βoptionalβ for is_elem_child_req, not βrequired.β I'm just the messenger, bestie. π
π is_elem_child_uniq ( TAG , CHILD ) π
Returns TRUE if an element is required and unique as a child of TAG.
π is_elem_pcdata ( TAG ) π
Returns TRUE if an element is PCDATA (has content).
π is_elem_empty ( TAG ) π
Returns TRUE if an element is EMPTY (doesn't have attributes, content or children). No cap.
π is_elem_multi ( TAG ) π
Returns TRUE if an element can have multiple occurrences globally.
π is_elem_opt ( TAG ) π
Returns TRUE if an element is optional globally.
π is_elem_parent ( TAG , @PARENTS ) π
Returns TRUE if the list of @PARENTS can be parent of element TAG.
π is_elem_req π
Returns TRUE if an element is required globally.
π is_elem_uniq π
Returns TRUE if an element is unique and required globally.
π root π
Returns the root name of the DTD.
π tree π
Returns the HASH tree of the DTD. Main character data structure energy.
π SEE ALSO π
XML::Smart, XML::DTDParser. Go look, bestie. π
π«Ά AUTHOR π«Ά
Graciliano M. P. <gm@virtuasites.com.br> wrote this. He says: βI will appreciate any type of feedback (include your opinions and/or suggestions). ;-Pβ Feedback is love, feedback is life.
π THANKS π
Thanks to Jenda@Krynicky.cz http://Jenda.Krynicky.cz β that's the author of XML::DTDParser. π«Ά
π COPYRIGHT π
The DTD parser was based on XML-DTDParser-1.7 by Jenda@Krynicky.cz http://Jenda.Krynicky.cz.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
This page is XML::Smart::DTD(3pm) from the User Contributed Perl Documentation, and the footer says perl v5.36.0 + 2022-11-19. Bye bestie, slay your DTDs πβ¨
π¦ where this page comes from
- debian bookworm: libxml-smart-perl 1.78-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libxml-smart-perl 1.78-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libxml-smart-perl 1.78-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libxml-smart-perl 1.78-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libxml-smart-perl 1.78-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms