DOM-ecmascript(3pm) | User Contributed Perl Documentation | DOM-ecmascript(3pm) |
DOM-ecmascript - XML::Grove and ECMA Script Language Binding
XML::Grove is similar in concept to the ECMA Script Language Binding to DOM Level 1 Core (Appendix E of the DOM Recommendation).
http://www.w3.org/TR/REC-DOM-Level-1/ ecma-script-language-binding.html <http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html>
The ECMA Script Language Binding presents DOM properties as ECMA Script object properties. The same is true for XML::Grove, XML::Grove 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, Perl hashes for NamedNodeLists so those object classes don't exist in XML::Grove. Because those classes don't exist, you use ordinary Perl syntax for manipulating the DOM properties (lists and named node lists) instead of methods like `"nextSibling()"' or `"replaceChild()"'. Element attributes in XML::Grove are stored in Perl hashes; attribute types are available through the document object.
Another difference is that 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.
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 provided by many PerlSAX parsers. PerlSAX parsers often provide additional properties or objects, refer to your PerlSAX parser documentation for details.
The "CData" object is called a "CDATASection" in DOM.
The "PI" object is called a "ProcessingInstruction" in DOM.
2018-07-12 | perl v5.26.2 |