XML::D...AttDef(3pm)
π NAME π
ok so bestie, gather round β XML::Doctype::AttDef is a whole class that represents one definition inside a <!ATTLIST> tag. that's the vibe. the manual name is XML::D...AttDef(3pm) if you need to cite your sources π
β¨ SYNOPSIS β¨
$attr = $elt->attribute( $name ) ;
$attr->name ;
like. that's it. that's the whole flex π
π¦ DESCRIPTION π¦
so this module is what you use to represent <!ELEMENT> tags inside an XML::Doctype object, no cap. and guess what β it holds <!ATTLIST> tags too. multitasking icon behavior fr fr π
πΈ STATUS πΈ
ok so real talk: this module is alpha code. it's developed enough to support XML::ValidWriter, but it needs a lot of work. some of the big things that are missing are... (and that's genuinely where the original list just ends, bestie, i'm not gatekeeping anything from you π)
π METHODS π
π new
$dtd = XML::Doctype::AttDef->new( $name, $type, $default ) ;
π default
( $spec, $value ) = $attr->default ;
$attr->default( '#REQUIRED' ) ;
$attr->default( '#IMPLIED' ) ;
$attr->default( '', 'foo' ) ;
$attr->default( '#FIXED', 'foo' ) ;
Sets/gets the default value. This is a
π«Ά okay so yes, that sentence literally ends at "This is a" in the original. i'm preserving it exactly because the rule is the rule. we love an unfinished thought. main character energy, honestly.
π quant
$attdef->quant( $q ) ;
$q = $attdef->quant ;
Sets/gets the attribute quantifier: '#REQUIRED', '#FIXED', '#IMPLIED', or ''. those are your four options, periodt π
π name
$attdef->name( $name ) ;
$name = $attdef->name ;
Sets/gets this attribute name. but do NOT change the name while an attribute is sitting in an element's attlist β because then it'll be filed under the wrong name and everything is chaos π like rearranging your contacts mid-group-chat. don't.
π default_on_write
$attdef->default_on_write( $value ) ;
$value = $attdef->default_on_write ;
$attdef->default_on_write( $attdef->default ) ;
Sets/gets the value that gets automatically output for this attribute if none is supplied to $writer->startTag. typically you'd use this to set a document-wide default for #REQUIRED attributes (and maybe plain attributes too) so the attribute gets treated like a #FIXED tag and emitted with a fixed value. iconic behavior tbh π₯
and heads up: the default_on_write doesn't have to match the default β unless the quantifier is #FIXED. iykyk.
π§ SUBCLASSING π§
this object uses the fields pragma, so if you're making subclasses you should use base and fields. that's the whole note. slay π
π 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.
and that's the whole page bestie β¨ this little gem is from the User Contributed Perl Documentation, shipped withperl v5.34.0, dated2022-06-28, under the manual nameXML::D...AttDef(3pm)β go forth and attribute-defend ππ¦πΈ
π¦ 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