XML::D...entDecl(3pm)
π NAME π
XML::Doctype::ElementDecl β bestie, it's a whole class that represents an <!ELEMENT> tag. That's it, that's the vibe. π
β¨ SYNOPSIS β¨
$elt = $dtd->element( 'foo' ) ;
$elt->name() ;
$elt->attr( 'foo' ) ;
okay so that's literally all you need to peek at it. slay. π
π¦ DESCRIPTION π¦
So likeβ¦ this module is the little guy that stands in for <!ELEMENT> tags inside an XML::Doctype object. and the plot twist? It also carries <!ATTLIST> tags around with it. multi-talented. main character energy fr fr. π
πΈ STATUS πΈ
heads up bestie β this module is alpha code. not finished, not polished, still in its awkward growing-out-bangs era. π
It is developed enough to support XML::ValidWriter, which is lowkey iconic of it. But it needs a lot of work. Some big things that are lacking are:
- (β¦nothing listed here, bestie. the list is just. empty. the void. the silence. π)
so yeah, imagine a bullet list with nothing in it. that's the energy we're working with.
π METHODS π
new
# Undefined element constructors:
$dtd = XML::Doctype::ElementDecl->new( $name ) ;
$dtd = XML::Doctype::ElementDecl->new( $name, undef, \@attdefs ) ;
# Defined element constructors
$dtd = XML::Doctype::ElementDecl->new( $name, \@kids, \@attdef ) ;
$dtd = XML::Doctype::ElementDecl->new( $name, [], \@attdefs ) ;
four flavors of construction, pick your fighter. two for undefined elements, two for defined ones. π«Ά
add_attdef
$elt_decl->add_attdef( $att_def ) ;
you hand it an attdef, it adds it. simple as. β¨
attdef
$attr = $elt->attdef( $name ) ;
Returns the XML::Doctype::AttDef named by $name, or undef if there is no such attribute. no attribute, no problem, just undef. π
attdefs
$attdefs = $elt->attdefs( $name ) ;
Returns the list of XML::Doctype::AttDef instances associated with this element. the whole squad. π
attribute_names
Returns a list of the attdefs' names. that's it. that's the method. short king. π
child_names
@names = $elt->child_names ;
Returns a list of names of elements in this element decl's content model. your element's kids, named and accounted for. π§
is_declared
if ( $elt_decl->is_declared ) ...
$elt_decl->is_declared( 1 ) ;
Returns TRUE if there is any data defined in the element other than name and attributes β or if is_declared has been set by calling is_declared( 1 ) or by passing DECLARED => 1 to new(). three ways to become declared. glow up. β
is_empty
no extra deets given, bestie β it's just here, existing, being mysterious. π
is_any
also just vibing here with zero elaboration. π
is_mixed
same situation. present. unexplained. iconic honestly. π«
name
$n = $elt_decl->name ;
Gets the name of the element. yep. the name. of the element. π
validate_content
$v = $elt_decl->validate_content( \@seq ) ;
Takes an ARRAY ref of tag names (or '#PCDATA') and checks to see if it would be valid content for elements of this type.
important bestie: right now, this must be called only when an element's end tag is emitted. It can be broadened to be incremental if need be β but for now, end tag only. no cap. π₯
π SUBCLASSING π
This object uses the fields pragma, so if you're subclassing, you should use base and fields for any subclasses. do it right, bestie. π
π AUTHOR π
Barrie Slaymaker <barries@slaysys.com>
π COPYRIGHT π
This module is Copyright 2000, 2005 Barrie Slaymaker. All rights reserved.
This module is licensed under your choice of the Artistic, BSD or General Public License. pick your fave, they're all valid. β¨
and that's a wrap, bestie!! π«Ά this little beauty is perl v5.34.0, dated 2022-06-28, and it lives under User Contributed Perl Documentation β go forth and declare those elements. mwah. π
π¦ where this page comes from
- debian bookworm: libxml-autowriter-perl 0.40-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libxml-autowriter-perl 0.40-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libxml-autowriter-perl 0.40-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libxml-autowriter-perl 0.40-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libxml-autowriter-perl 0.40-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms