home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / share / doc / libxml-grove-perl / DOM-ecmascript.pod < prev    next >
Encoding:
Text File  |  2004-10-28  |  3.8 KB  |  170 lines

  1. =head1 NAME
  2.  
  3. XML::Grove and DOM Level One
  4.  
  5. =head1 XML::Grove and DOM Level One
  6.  
  7. XML::Grove is similar in concept to the ECMA Script Language Binding
  8. to DOM Level 1 Core (Appendix E of the DOM Recommendation).
  9.  
  10. <http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html>
  11.  
  12. The ECMA Script Language Binding presents DOM properties as ECMA
  13. Script object properties.  The same is true for XML::Grove, XML::Grove
  14. presents DOM properties as Perl blessed hashes.
  15.  
  16. The biggest difference between the ECMA Script Language Binding and
  17. XML::Grove is that XML::Grove uses a Perl hash for nodes, Perl arrays
  18. for NodeLists, Perl hashes for NamedNodeLists so those object classes
  19. don't exist in XML::Grove.  Because those classes don't exist, you use
  20. ordinary Perl syntax for manipulating the DOM properties (lists and
  21. named node lists) instead of methods like `C<nextSibling()>' or
  22. `C<replaceChild()>'.  Element attributes in XML::Grove are stored in
  23. Perl hashes; attribute types are available through the document
  24. object.
  25.  
  26. Another difference is that XML::Grove attempts to marry the PerlSAX
  27. and DOM naming so that less (no?) name-changing occurs between using
  28. PerlSAX interfaces and filters and DOM modules.  Where conflicts
  29. occur, the PerlSAX naming is used.
  30.  
  31. XML::Grove uses a blessed hash for nodes, so the node type is
  32. available using Perl's `C<ref()>' instead of using a `C<nodeType()>'
  33. method and all class names are prefixed with `C<XML::Grove::>'.
  34.  
  35. The following object descriptions are the most basic and common
  36. provided by many PerlSAX parsers.  PerlSAX parsers often provide
  37. additional properties or objects, refer to your PerlSAX parser
  38. documentation for details.
  39.  
  40. =head1 Document Object Model Level 1 Core
  41.  
  42. =head2 Object XML::Grove::Document
  43.  
  44. =over 12
  45.  
  46. =item Contents
  47.  
  48. The children of this object.  This property is an array.
  49.  
  50. =item Entities
  51.  
  52. The entities declared in this document.  This property is a hash of
  53. XML::Grove::Entity objects keyed by entity name.
  54.  
  55. =item Notations
  56.  
  57. The notations declared in this document.  This property is a hash of
  58. XML::Grove::Notation objects keyed by notation name.
  59.  
  60. =back
  61.  
  62. =head2 Object XML::Grove::Element
  63.  
  64. =over 12
  65.  
  66. =item Name
  67.  
  68. The tag type name for this element.  This property is a string.
  69.  
  70. =item Attributes
  71.  
  72. The attributes for this element.  This property is a hash and it's
  73. hash values are strings (or arrays with some grove builders).
  74.  
  75. =item Contents
  76.  
  77. The children of this object.  This property is an array of XML::Grove
  78. objects.
  79.  
  80. =back
  81.  
  82. =head2 Object XML::Grove::Characters
  83.  
  84. =over 12
  85.  
  86. =item Data
  87.  
  88. The text of the character data.  This property is a string.
  89.  
  90. =back
  91.  
  92. =head2 Object XML::Grove::Comment
  93.  
  94. =over 12
  95.  
  96. =item Data
  97.  
  98. The text of the character data.  This property is a string.
  99.  
  100. =back
  101.  
  102. =head2 Object XML::Grove::CData
  103.  
  104. The C<CData> object is called a C<CDATASection> in DOM.
  105.  
  106. =over 12
  107.  
  108. =item Data
  109.  
  110. The text of the character data.  This property is a string.
  111.  
  112. =back
  113.  
  114. =head2 Object XML::Grove::Notation
  115.  
  116. =over 12
  117.  
  118. =item Name
  119.  
  120. The name of this notation.  This property is a string.
  121.  
  122. =item SystemId
  123.  
  124. The system identifier of this notation.  This property is a string.
  125.  
  126. =item PublicId
  127.  
  128. The public identifier of this notation.  This property is a string.
  129.  
  130. =back
  131.  
  132. =head2 Object XML::Grove::Entity
  133.  
  134. =over 12
  135.  
  136. =item Name
  137.  
  138. The name of this entity.  This property is a string.
  139.  
  140. =item SystemId
  141.  
  142. The system identifier of this notation.  This property is a string.
  143.  
  144. =item PublicId
  145.  
  146. The public identifier of this notation.  This property is a string.
  147.  
  148. =item Notation
  149.  
  150. The notation declared for this entity.  This property is either the
  151. name of the notation as a string or an C<XML::Grove::Notation> object.
  152.  
  153. =back
  154.  
  155. =head2 Object XML::Grove::PI
  156.  
  157. The C<PI> object is called a C<ProcessingInstruction> in DOM.
  158.  
  159. =over 12
  160.  
  161. =item Target
  162.  
  163. The target of the processing instruction.  This property is a string.
  164.  
  165. =item Data
  166.  
  167. The text of the processing instruction.  This property is a string.
  168.  
  169. =back
  170.