Introduction To Dom

771 views
719 views

Published on

Document Object Model in XML

Published in: Education, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
771
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
33
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Introduction To Dom

  1. 1. CIS-189
  2. 2.  DOM stands for Document Object Model  Provides tools for working with XML document in memory ◦ Tools include navigating and editing document ◦ “Interface” refers to how you interact with an object  What is accessible outside of object?
  3. 3.  XML document in memory called XML Information Set or Infoset  DOM is a logical model ◦ How represented in memory may be different from how document exists on disk ◦ Uses Nodes to represent XML Tree and contents
  4. 4.  Moving data from active memory to disk  Serialization moves data from objects in memory to disk  Deserialization moves data from disk to objects in memory
  5. 5.  Defines what interfaces (tools) will be provided ◦ Focus is on results ◦ Doesn’t specify how a tool will work  Software providers can provide additional tools ◦ IE might process instructions that Firefox can’t
  6. 6.  Node represents the basic object in a document ◦ Different kinds of nodes represent different purposes and values ◦ All types of nodes inherit same initial definition  One node can “own” another node ◦ Function similar to Windows tree-view of file system ◦ Type of node can affect how object responds to code
  7. 7.  Document  Document Type  Document Fragment  Element  Entity Reference  Entity  Attribute  Processing Instruction  Comment  CDATA  Text  Notation
  8. 8.  Different types of nodes can have different types of child nodes, or no child nodes  Document node represents highest level ◦ Document node can have Element, Document type, Processing Instruction, Comment nodes ◦ Document type, Processing instruction, Comment nodes cannot have child nodes
  9. 9. Document Element Element Comment Document Type Document Type Processing Instruction Cannot have child nodes
  10. 10.  Can have as child nodes: Element, Comment, Processing instruction, Text, CDATA, Entity reference  Attributes of an element exist in Attribute nodes ◦ Attribute nodes are not considered child and are not part of DOM tree
  11. 11. Document Element (root) Element Element Comment Comment Element Attribute
  12. 12.  Portion of an XML document  Has same “ownership” possibilities as an Element  Does NOT have to be well-formed  Isn’t a complete XML document

×