SlideShare a Scribd company logo
XML DOM
1
XML DOM
 The XML DOM defines a standard for accessing and
manipulating XML.
 The DOM is a W3C (World Wide Web Consortium)
standard.
 The DOM defines a standard for accessing documents like
XML and HTML:
 The W3C Document Object Model (DOM) is a platform and
language-neutral interface that allows programs and scripts to
dynamically access and update the content, structure, and
style of a document.
2
The DOM is separated into 3
different parts / levels:
 Core DOM - standard model for any structured
document
 XML DOM - standard model for XML documents
 HTML DOM - standard model for HTML documents
3
What is the XML DOM?
 The XML DOM defines the objects and
properties of all XML elements, and
the methods (interface) to access them.
 In other words: The XML DOM is a standard for
how to get, change, add, or delete XML
elements.
4
XML SAX
 SAX (Simple API for XML) is an event-
based sequential access parser API developed by the
XML-DEV mailing list for XMLdocuments.
 SAX provides a mechanism for reading data from an
XML document that is an alternative to that provided by
the Document Object Model (DOM).
 SAX parsers operate on each piece of the XML
document sequentially.
5
Benefits
 SAX parsers have some benefits over DOM-style parsers.
 A SAX parser only needs to report each parsing event as it
happens, and normally discards almost all of that information
once reported
 Thus, the minimum memory required for a SAX parser is
proportional to the maximum depth of the XML file (i.e., of
the XML tree) and the maximum data involved in a single.
 XML event (such as the name and attributes of a single start-
tag, or the content of a processing instruction, etc.)
6
Drawbacks
 The event-driven model of SAX is useful for XML parsing,
but it does have certain drawbacks.
 Virtually any kind of XML validation requires access to the
document in full. The most trivial example is that an
attribute declared in the DTD to be of type IDREF, requires
that there be an element in the document that uses the same
value for an ID attribute.
 To validate this in a SAX parser, one must keep track of all ID
attributes (any one of them might end up being referenced by
an IDREF attribute at the very end); as well as every IDREF
attribute until it is resolved.
7

More Related Content

PDF
DOCX
PPT
uptu web technology unit 2 Xml2
PPT
uptu web technology unit 2 Xml2
PPT
uptu web technology unit 2 Xml2
PPTX
Dom parser
uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2
Dom parser

What's hot (20)

PPTX
Xml processors
PPTX
Xml dom
PPT
Understanding XML DOM
PPTX
Xml and xml processor
PPT
Introduction to XML
PPTX
Introduction to XML
PPT
XML Databases
PPTX
Xml dtd- Document Type Definition- Web Technology
PPT
XML and Databases
PDF
Introduction to XML
PPTX
XML Document Object Model (DOM)
PDF
Introduction to XML and Databases
PPT
uptu web technology unit 2 Xml2
PDF
Dom Hackking & Security - BlackHat Preso
PPTX
Working with xml data
Xml processors
Xml dom
Understanding XML DOM
Xml and xml processor
Introduction to XML
Introduction to XML
XML Databases
Xml dtd- Document Type Definition- Web Technology
XML and Databases
Introduction to XML
XML Document Object Model (DOM)
Introduction to XML and Databases
uptu web technology unit 2 Xml2
Dom Hackking & Security - BlackHat Preso
Working with xml data
Ad

Viewers also liked (12)

PPT
PPTX
Semantic web xml-rdf-dom parser
PPTX
Introduce to XML
PPT
Dino's DEV Project
PPT
Xml parsers
PPT
XML SAX PARSING
PDF
Parsing XML Data
PPT
5 xml parsing
PDF
XML DOM
PPTX
java API for XML DOM
PPT
6 xml parsing
PPT
DOM and SAX
Semantic web xml-rdf-dom parser
Introduce to XML
Dino's DEV Project
Xml parsers
XML SAX PARSING
Parsing XML Data
5 xml parsing
XML DOM
java API for XML DOM
6 xml parsing
DOM and SAX
Ad

Similar to Xml3 (20)

PPTX
Xml and xml processor
PPTX
Applied xml programming for microsoft
PDF
Python xml processing
PPT
PDF
CTDA Workshop on XML and MODS
PDF
Enhanced xml validation using srml01
PPT
Web services Overview in depth
PPTX
Unit iv xml dom
PPT
What is xml
PDF
PPTX
XML Introduction
PPTX
Xml andweb services
PPTX
XML
PPTX
advDBMS_XML.pptx
PDF
E05412327
PDF
Introduction to xml
PPT
XML-Unit 1.ppt
PPT
DATA INTEGRATION (Gaining Access to Diverse Data).ppt
PDF
XML-talk
PPT
unit_5_XML data integration database management
Xml and xml processor
Applied xml programming for microsoft
Python xml processing
CTDA Workshop on XML and MODS
Enhanced xml validation using srml01
Web services Overview in depth
Unit iv xml dom
What is xml
XML Introduction
Xml andweb services
XML
advDBMS_XML.pptx
E05412327
Introduction to xml
XML-Unit 1.ppt
DATA INTEGRATION (Gaining Access to Diverse Data).ppt
XML-talk
unit_5_XML data integration database management

More from Abhishek Kesharwani (20)

PDF
Software Engineering unit 1 Notes AKTU ppt
PPTX
Software Engineering unit 1 Notes AKTU ppt
PPTX
uptu web technology unit 2 html
PPTX
uptu web technology unit 2 html
PPTX
uptu web technology unit 2 html
PPTX
uptu web technology unit 2 html
PPTX
uptu web technology unit 2 html
PPTX
uptu web technology unit 2 Css
PPTX
uptu web technology unit 2 Css
PPTX
Unit 1 web technology uptu slide
PDF
Unit1 Web Technology UPTU UNIT 1
PPTX
PDF
Web Technology UPTU UNIT 1
DOCX
Mtech syllabus computer science uptu
PDF
Wi max tutorial
PDF
Virtual lan
DOCX
Virtual lan
PPT
Tcp traffic control and red ecn
PDF
Schedulling
PDF
Software Engineering unit 1 Notes AKTU ppt
Software Engineering unit 1 Notes AKTU ppt
uptu web technology unit 2 html
uptu web technology unit 2 html
uptu web technology unit 2 html
uptu web technology unit 2 html
uptu web technology unit 2 html
uptu web technology unit 2 Css
uptu web technology unit 2 Css
Unit 1 web technology uptu slide
Unit1 Web Technology UPTU UNIT 1
Web Technology UPTU UNIT 1
Mtech syllabus computer science uptu
Wi max tutorial
Virtual lan
Virtual lan
Tcp traffic control and red ecn
Schedulling

Xml3

  • 2. XML DOM  The XML DOM defines a standard for accessing and manipulating XML.  The DOM is a W3C (World Wide Web Consortium) standard.  The DOM defines a standard for accessing documents like XML and HTML:  The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document. 2
  • 3. The DOM is separated into 3 different parts / levels:  Core DOM - standard model for any structured document  XML DOM - standard model for XML documents  HTML DOM - standard model for HTML documents 3
  • 4. What is the XML DOM?  The XML DOM defines the objects and properties of all XML elements, and the methods (interface) to access them.  In other words: The XML DOM is a standard for how to get, change, add, or delete XML elements. 4
  • 5. XML SAX  SAX (Simple API for XML) is an event- based sequential access parser API developed by the XML-DEV mailing list for XMLdocuments.  SAX provides a mechanism for reading data from an XML document that is an alternative to that provided by the Document Object Model (DOM).  SAX parsers operate on each piece of the XML document sequentially. 5
  • 6. Benefits  SAX parsers have some benefits over DOM-style parsers.  A SAX parser only needs to report each parsing event as it happens, and normally discards almost all of that information once reported  Thus, the minimum memory required for a SAX parser is proportional to the maximum depth of the XML file (i.e., of the XML tree) and the maximum data involved in a single.  XML event (such as the name and attributes of a single start- tag, or the content of a processing instruction, etc.) 6
  • 7. Drawbacks  The event-driven model of SAX is useful for XML parsing, but it does have certain drawbacks.  Virtually any kind of XML validation requires access to the document in full. The most trivial example is that an attribute declared in the DTD to be of type IDREF, requires that there be an element in the document that uses the same value for an ID attribute.  To validate this in a SAX parser, one must keep track of all ID attributes (any one of them might end up being referenced by an IDREF attribute at the very end); as well as every IDREF attribute until it is resolved. 7