SlideShare uma empresa Scribd logo
1 de 19
Seminar On:
XML & XML
Processor
Submitted By: Himanshu Soni
Branch: CS
Roll No: 1301410040
Subject: Web Technolgy
(NCS-504)
 Introduction to XML
 HTML Vs XML
 Structure of XML Document
 XML Processor
 Parser
 DOM & SAX
 References
Introduction to XML
What is XML ?
 XML is an acronym for “eXtensible Markup
Language”.
 XML is a markup language derived from
SGML (Standard Generalised Markup
language).
 It is used to store data in structured format.
HTML vs XML
HTML XML
HTML document formats and
displays web page data.
XML document carry data along
with their description.
Predefined tags (Predefined
markup language).
Not have predefined tags.You
can create and define new tags
as per your needs.(Meta
Language).
May not have closing tag. Must have closing tag.
Not Case Sensitive. Case Sensitive.
Directly Viewable in browser. Viewable if proper Stylesheet
provided.
HTML
Browser
StylesheetXML
Structure of XML Document System
 A style sheet presentation through CSS or XSL.
 A grammer structure through DTD.
 A semantics of data through XML file.
Semantics and
data,
XML file
Grammer
Structure,
DTD
Syle-sheet,
CSS or XSL
Structure of XML file
XML file has –
-a logical structure and
- a physical structure
Logical Structure:
It refers to different parts of
document i.e., how document is built.
Physical Structure:
It refers what document actually
contains.
Logical Structure
-prolog (preface or introduction to XML document)
-data instance (the real or actual data)
Prolog Data Instance
 An XMl declaration
 Processing Instruction
 A document type definition
 Comments
 White Spaces
 Element types, tags and
names
 White Spaces
Prolog
XML declaration
<? xml version=“1.0” encoding= “UTF-8” standalone=“no” ?>
Processing Instruction
<? xml-stylesheet type=“text/css” href=“main.css” ?>
Document Type Declaration (DTD)
<! DOCTYPE rootElement SYSTEM DTD_File_Name.dtd>
Comments
<!– Listen Here -->
White Spaces
Spaces, tabs, linebreak
XML Processor
 When a software program reads an XML
document and takes actions accordingly, this
is called processing the XML.
 Any program that can read and process XML
documents is known as an XML processor.
 An XML processor reads the XML file and
turns it into in-memory structures that the
rest of the program can access.
What is Parser?
The word parser comes from compilers. In a
compiler, a parser is the module that reads and
interprets the programming language.
Parsers are software components that decode XML
files on behalf of the application
There are two basic ways to interface a parser with
an application:
-object-based interfaces
-event-based interfaces
Architecture of XML Program
Divided into two parts:
• The parser deals with the XML file.
• The application consumes the content of the file through the
parser.
Here application can be very simple (such as printing information on
the screen), or quite complex (such as a browser or an editor)
Object-based Interface
 Using an object-based interface, the parser explicitly builds
a tree of objects that contains all the elements in the XML
document.
 Tree-based parsers deal generally small documents
Example-
<?xml version=”1.0”?>
<products>
<product>
<name>XML Editor</name>
<price>499.00</price>
</product>
<product>
<name>DTD Editor</name>
<price>199.00</price>
</product>
<products>
Building the tree of objects
Event-based Interface
 With an event-based interface, the parser does not explicitly
build a tree of objects.
 Instead, it reads the file and generates events as it finds
elements, attributes, or text in the file.
 There are events for element starts, element ends,
attributes, text content, entities, and so on.
 Event-based parsers deal generally used for large
documents
An event-based API
DOM
 The Document Object Model (DOM) is an
application programming interface (API) for HTML
and XML documents.
 It defines the logical structure of documents and
the way a document is accessed and manipulated
 Programmers can build documents, navigate their
structure, and add, modify, or delete elements and
content i.e.
The API allows for constructing, accessing and
manipulating the structure and content of XML
documents
 Basically, DOM is object based parser
DOM
DOM Parser DOM TreeXML File
A
P
I
Application
SAX
 SAX (Simple API for XML) is an event-
driven algorithm for parsing XML documents.
 SAX provides a mechanism for reading data from
an XML document.
 SAX parsers operate on each piece of the XML
document sequentially.
 SAX parsing is unidirectional; previously parsed
data cannot be re-read without starting the
parsing operation again
SAX vs DOM Parsing: Efficiency
The DOM object built by DOM parsers is usually
complicated and requires more memory storage than
the XML file itself
A lot of time is spent on construction before use
For some very large documents, this may be
impractical
SAX parsers store only local information that is
encountered during the serial traversal.
Hence, programming with SAX parsers is, in
general, more efficient but difficult to implement
sonetime.
References
 Benoit Marchal. XML by Example. 1 edition. QUE
(14 December 1999)
 Pankaj Sharma. Introduction to Web Technology.
S.K. Kataria & Sons
 Sumita Arora. Informatics Practices. Dhanpat Rai &
Co. (P) Ltd., Delhi 2010
 https://en.wikipedia.org/wiki/XML

Mais conteúdo relacionado

Mais procurados (20)

Xml databases
Xml databasesXml databases
Xml databases
 
uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2
 
Xml 1
Xml 1Xml 1
Xml 1
 
uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2
 
Intro xml
Intro xmlIntro xml
Intro xml
 
uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2
 
uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Xml
XmlXml
Xml
 
XML and XML Applications - Lecture 04 - Web Information Systems (WE-DINF-11912)
XML and XML Applications - Lecture 04 - Web Information Systems (WE-DINF-11912)XML and XML Applications - Lecture 04 - Web Information Systems (WE-DINF-11912)
XML and XML Applications - Lecture 04 - Web Information Systems (WE-DINF-11912)
 
Xml applications
Xml applicationsXml applications
Xml applications
 
XML
XMLXML
XML
 
Xml programming language myassignmenthelp.net
Xml programming  language myassignmenthelp.netXml programming  language myassignmenthelp.net
Xml programming language myassignmenthelp.net
 
XML
XMLXML
XML
 
XML-Extensible Markup Language
XML-Extensible Markup Language XML-Extensible Markup Language
XML-Extensible Markup Language
 
XML
XMLXML
XML
 
Xml dom
Xml domXml dom
Xml dom
 
XML - Data Modeling
XML - Data ModelingXML - Data Modeling
XML - Data Modeling
 
XML
XMLXML
XML
 
XML
XMLXML
XML
 

Destaque

LVS Into Booklet March 2015
LVS Into Booklet March 2015LVS Into Booklet March 2015
LVS Into Booklet March 2015Kirt Hebert
 
TheVillageFinalBusinesPlan
TheVillageFinalBusinesPlanTheVillageFinalBusinesPlan
TheVillageFinalBusinesPlanSam Buckingham
 
Product innovationprogram informativo_julio2016_2
Product innovationprogram informativo_julio2016_2Product innovationprogram informativo_julio2016_2
Product innovationprogram informativo_julio2016_2Dennys Choque Chara
 
Google Earth Virtual Tour
Google Earth Virtual TourGoogle Earth Virtual Tour
Google Earth Virtual Touraservis
 
Indonesia: A Decade of Revolution in Social Media
Indonesia: A Decade of Revolution in Social MediaIndonesia: A Decade of Revolution in Social Media
Indonesia: A Decade of Revolution in Social MediaUrbanIndonesia
 
Automatic room temperature controlled fan using arduino uno microcontroller
Automatic room temperature controlled fan using   arduino uno  microcontrollerAutomatic room temperature controlled fan using   arduino uno  microcontroller
Automatic room temperature controlled fan using arduino uno microcontrollerMohammod Al Emran
 

Destaque (12)

LVS Into Booklet March 2015
LVS Into Booklet March 2015LVS Into Booklet March 2015
LVS Into Booklet March 2015
 
TheVillageFinalBusinesPlan
TheVillageFinalBusinesPlanTheVillageFinalBusinesPlan
TheVillageFinalBusinesPlan
 
SCHOOL_TRANSCRIPT
SCHOOL_TRANSCRIPTSCHOOL_TRANSCRIPT
SCHOOL_TRANSCRIPT
 
Product innovationprogram informativo_julio2016_2
Product innovationprogram informativo_julio2016_2Product innovationprogram informativo_julio2016_2
Product innovationprogram informativo_julio2016_2
 
CV
CVCV
CV
 
Training
TrainingTraining
Training
 
Open source prez
Open source prezOpen source prez
Open source prez
 
Google Earth Virtual Tour
Google Earth Virtual TourGoogle Earth Virtual Tour
Google Earth Virtual Tour
 
Mshary saud CV -2015
Mshary saud CV -2015Mshary saud CV -2015
Mshary saud CV -2015
 
ACC Chandrapur
ACC ChandrapurACC Chandrapur
ACC Chandrapur
 
Indonesia: A Decade of Revolution in Social Media
Indonesia: A Decade of Revolution in Social MediaIndonesia: A Decade of Revolution in Social Media
Indonesia: A Decade of Revolution in Social Media
 
Automatic room temperature controlled fan using arduino uno microcontroller
Automatic room temperature controlled fan using   arduino uno  microcontrollerAutomatic room temperature controlled fan using   arduino uno  microcontroller
Automatic room temperature controlled fan using arduino uno microcontroller
 

Semelhante a Xml and xml processor (20)

Unit 2.3
Unit 2.3Unit 2.3
Unit 2.3
 
Unit 2.3
Unit 2.3Unit 2.3
Unit 2.3
 
Applied xml programming for microsoft
Applied xml programming for microsoftApplied xml programming for microsoft
Applied xml programming for microsoft
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
Xml parsing
Xml parsingXml parsing
Xml parsing
 
Xml
XmlXml
Xml
 
Xml
XmlXml
Xml
 
XML Tutor maXbox starter27
XML Tutor maXbox starter27XML Tutor maXbox starter27
XML Tutor maXbox starter27
 
UNIT-1 Web services
UNIT-1 Web servicesUNIT-1 Web services
UNIT-1 Web services
 
Oracle soa xml faq
Oracle soa xml faqOracle soa xml faq
Oracle soa xml faq
 
Full xml
Full xmlFull xml
Full xml
 
XMl
XMlXMl
XMl
 
Xml
XmlXml
Xml
 
Xml3
Xml3Xml3
Xml3
 
Xml3
Xml3Xml3
Xml3
 
CTDA Workshop on XML and MODS
CTDA Workshop on XML and MODSCTDA Workshop on XML and MODS
CTDA Workshop on XML and MODS
 
Module 5 XML Notes.pdf
Module 5 XML Notes.pdfModule 5 XML Notes.pdf
Module 5 XML Notes.pdf
 
XML notes.pptx
XML notes.pptxXML notes.pptx
XML notes.pptx
 
XML
XMLXML
XML
 
Markup For Dummies (Russ Ward)
Markup For Dummies (Russ Ward)Markup For Dummies (Russ Ward)
Markup For Dummies (Russ Ward)
 

Último

Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...soginsider
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 

Último (20)

Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 

Xml and xml processor

  • 1. Seminar On: XML & XML Processor Submitted By: Himanshu Soni Branch: CS Roll No: 1301410040 Subject: Web Technolgy (NCS-504)  Introduction to XML  HTML Vs XML  Structure of XML Document  XML Processor  Parser  DOM & SAX  References
  • 2. Introduction to XML What is XML ?  XML is an acronym for “eXtensible Markup Language”.  XML is a markup language derived from SGML (Standard Generalised Markup language).  It is used to store data in structured format.
  • 3. HTML vs XML HTML XML HTML document formats and displays web page data. XML document carry data along with their description. Predefined tags (Predefined markup language). Not have predefined tags.You can create and define new tags as per your needs.(Meta Language). May not have closing tag. Must have closing tag. Not Case Sensitive. Case Sensitive. Directly Viewable in browser. Viewable if proper Stylesheet provided.
  • 5. Structure of XML Document System  A style sheet presentation through CSS or XSL.  A grammer structure through DTD.  A semantics of data through XML file. Semantics and data, XML file Grammer Structure, DTD Syle-sheet, CSS or XSL
  • 6. Structure of XML file XML file has – -a logical structure and - a physical structure Logical Structure: It refers to different parts of document i.e., how document is built. Physical Structure: It refers what document actually contains.
  • 7. Logical Structure -prolog (preface or introduction to XML document) -data instance (the real or actual data) Prolog Data Instance  An XMl declaration  Processing Instruction  A document type definition  Comments  White Spaces  Element types, tags and names  White Spaces
  • 8. Prolog XML declaration <? xml version=“1.0” encoding= “UTF-8” standalone=“no” ?> Processing Instruction <? xml-stylesheet type=“text/css” href=“main.css” ?> Document Type Declaration (DTD) <! DOCTYPE rootElement SYSTEM DTD_File_Name.dtd> Comments <!– Listen Here --> White Spaces Spaces, tabs, linebreak
  • 9. XML Processor  When a software program reads an XML document and takes actions accordingly, this is called processing the XML.  Any program that can read and process XML documents is known as an XML processor.  An XML processor reads the XML file and turns it into in-memory structures that the rest of the program can access.
  • 10. What is Parser? The word parser comes from compilers. In a compiler, a parser is the module that reads and interprets the programming language. Parsers are software components that decode XML files on behalf of the application There are two basic ways to interface a parser with an application: -object-based interfaces -event-based interfaces
  • 11. Architecture of XML Program Divided into two parts: • The parser deals with the XML file. • The application consumes the content of the file through the parser. Here application can be very simple (such as printing information on the screen), or quite complex (such as a browser or an editor)
  • 12. Object-based Interface  Using an object-based interface, the parser explicitly builds a tree of objects that contains all the elements in the XML document.  Tree-based parsers deal generally small documents Example- <?xml version=”1.0”?> <products> <product> <name>XML Editor</name> <price>499.00</price> </product> <product> <name>DTD Editor</name> <price>199.00</price> </product> <products>
  • 13. Building the tree of objects
  • 14. Event-based Interface  With an event-based interface, the parser does not explicitly build a tree of objects.  Instead, it reads the file and generates events as it finds elements, attributes, or text in the file.  There are events for element starts, element ends, attributes, text content, entities, and so on.  Event-based parsers deal generally used for large documents An event-based API
  • 15. DOM  The Document Object Model (DOM) is an application programming interface (API) for HTML and XML documents.  It defines the logical structure of documents and the way a document is accessed and manipulated  Programmers can build documents, navigate their structure, and add, modify, or delete elements and content i.e. The API allows for constructing, accessing and manipulating the structure and content of XML documents  Basically, DOM is object based parser
  • 16. DOM DOM Parser DOM TreeXML File A P I Application
  • 17. SAX  SAX (Simple API for XML) is an event- driven algorithm for parsing XML documents.  SAX provides a mechanism for reading data from an XML document.  SAX parsers operate on each piece of the XML document sequentially.  SAX parsing is unidirectional; previously parsed data cannot be re-read without starting the parsing operation again
  • 18. SAX vs DOM Parsing: Efficiency The DOM object built by DOM parsers is usually complicated and requires more memory storage than the XML file itself A lot of time is spent on construction before use For some very large documents, this may be impractical SAX parsers store only local information that is encountered during the serial traversal. Hence, programming with SAX parsers is, in general, more efficient but difficult to implement sonetime.
  • 19. References  Benoit Marchal. XML by Example. 1 edition. QUE (14 December 1999)  Pankaj Sharma. Introduction to Web Technology. S.K. Kataria & Sons  Sumita Arora. Informatics Practices. Dhanpat Rai & Co. (P) Ltd., Delhi 2010  https://en.wikipedia.org/wiki/XML