XML::D...AttDef(3pm)

πŸ“¦
version 0.40 Β· 2 versions
  • 0.40 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.40 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

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


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 with perl v5.34.0, dated 2022-06-28, under the manual name XML::D...AttDef(3pm) β€” go forth and attribute-defend πŸ’–πŸ¦‹πŸŒΈ
πŸ“¦ where this page comes from