DOM-ecmascript(3pm)
β¨ NAME β¨
DOM-ecmascript β XML::Grove and ECMA Script Language Binding π¦
πΈ XML::Grove and DOM Level One πΈ
okay so bestie, here's the tea: XML::Grove is similar in concept to the ECMA Script Language Binding to DOM Level 1 Core β that's Appendix E of the DOM Recommendation, iykyk π
the whole thing lives at http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html
so like, the ECMA Script Language Binding presents DOM properties as ECMA Script object properties. and XML::Grove? literally the same energy: it presents DOM properties as Perl blessed hashes π
the biggest difference between the ECMA Script Language Binding and XML::Grove is that XML::Grove uses a Perl hash for nodes, Perl arrays for NodeLists, and Perl hashes for NamedNodeLists β so those object classes just... don't exist in XML::Grove π«₯ and because those classes don't exist, you use ordinary Perl syntax for manipulating the DOM properties (the lists and named node lists) instead of methods like nextSibling() or replaceChild(). no cap. Element attributes in XML::Grove are stored in Perl hashes, and attribute types are available through the document object β¨
another difference (yes there's more, stay with me π): XML::Grove attempts to marry the PerlSAX and DOM naming so that less (no?) name-changing occurs between using PerlSAX interfaces and filters and DOM modules. where conflicts occur, the PerlSAX naming is used. periodt.
also XML::Grove uses a blessed hash for nodes, so the node type is available using Perl's ref() instead of using a nodeType() method β and all class names are prefixed with XML::Grove:: π
the following object descriptions are the most basic and common ones provided by many PerlSAX parsers. PerlSAX parsers often provide additional properties or objects, so refer to your PerlSAX parser documentation for details π
π Document Object Model Level 1 Core π
π Object XML::Grove::Document
Contentsβ the children of this object. this property is an array πEntitiesβ the entities declared in this document. this property is a hash ofXML::Grove::Entityobjects keyed by entity name.Notationsβ the notations declared in this document. this property is a hash ofXML::Grove::Notationobjects keyed by notation name.
π Object XML::Grove::Element
Nameβ the tag type name for this element. this property is a string β¨Attributesβ the attributes for this element. this property is a hash, and its hash values are strings (or arrays with some grove builders) πContentsβ the children of this object. this property is an array ofXML::Groveobjects.
π Object XML::Grove::Characters
Dataβ the text of the character data. this property is a string π
π Object XML::Grove::Comment
Dataβ the text of the character data. this property is a string π
π Object XML::Grove::CData
heads up: theCDataobject is called aCDATASectionin DOM π§
Dataβ the text of the character data. this property is a string.
π Object XML::Grove::Notation
Nameβ the name of this notation. this property is a string.SystemIdβ the system identifier of this notation. this property is a string.PublicIdβ the public identifier of this notation. this property is a string.
π Object XML::Grove::Entity
Nameβ the name of this entity. this property is a string.SystemIdβ the system identifier of this notation. this property is a string.PublicIdβ the public identifier of this notation. this property is a string.Notationβ the notation declared for this entity. this property is either the name of the notation as a string or anXML::Grove::Notationobject π₯
π Object XML::Grove::PI
heads up again: thePIobject is called aProcessingInstructionin DOM π§
Targetβ the target of the processing instruction. this property is a string.Dataβ the text of the processing instruction. this property is a string.
and that's the whole page bestie, you ate that π
this lil' doc is perl v5.36.0 coded up on 2022-11-29, and yes it's the DOM-ecmascript(3pm) page from the User Contributed Perl Documentation β go forth and grove, icon π«ΆπΈ
π¦ where this page comes from
- debian bookworm: libxml-grove-perl 0.46alpha-14 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libxml-grove-perl 0.46alpha-14 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libxml-grove-perl 0.46alpha-14 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libxml-grove-perl 0.46alpha-14 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libxml-grove-perl 0.46alpha-14 Β· 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