XML::Smart::DTD(3pm)

πŸ“¦
version 1.78 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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. 🫢

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