SlideShare a Scribd company logo
Applied XML
Programming for
Microsoft .NET
PART 1
The .NET XML Parsing Model
1. XML is a natural element of all forms of programming life.
2. XML in the .NET Framework
The .NET Framework XML core classes can be categorized according to their functions:
1. reading and writing documents
2. validating documents
3. navigating and selecting nodes
4. managing schema information
5. performing document transformations
The assembly in which the whole XML .NET Framework is implemented is system.xml.dll
The most commonly used namespaces are listed here:
1. System.Xml
2. System.Xml.Schema
3. System.Xml.XPath
4. System.Xml.Xsl
The .NET Framework also provides for XML object serialization.
The classes involved with this functionality are grouped in the System.Xml.Serialization
namespace.
XML serialization writes objects to, and reads them from, XML documents.
This kind of serialization is particularly useful over the Web in combination with the Simple
Object Access Protocol (SOAP) and within the boundaries of .NET Framework XML Web services.
Areas of the .NET Framework in Which XML Is Key
Category Description
ADO.NET Data container objects (for example, the DataSet
object) are always transferred and remoted via XML
Configuration Application settings are stored in XML files, making
use of predefined and user-defined section readers.
Remoting Remote .NET Framework objects can be accessed
by using SOAP packets to prepare and perform the
call.
Web services SOAP is a lightweight XML protocol that Web
services use for the exchange of information in a
decentralized, distributed environment.
XML parsing The core classes providing for XML parsing and
manipulation through both the stream-based API
and the XML Document Object Model (XMLDOM).
XML serialization Supplies the ability to save and restore living
instances of objects to and from XML documents
Classes for Parsing
The available XML parsers fall into one of two main categories:
1. tree-based parsers
2. event-based parsers
XML and ADO.NET
The interaction between ADO.NET classes and XML documents takes one of two
forms:
Serialization of ADO.NET objects (in particular, the DataSet object) to
XML documents and corresponding deserialization. Data can be saved to
XML in a variety of formats, with or without schema information, as a full
snapshot of the in-memory data including pending changes and errors, or
with just the current instance of the data
A dual-access model that lets you access and update the same piece of data either through a
hierarchical programming interface or using the ADO.NET relational API. Basically, you can
transform a DataSet object into an XMLDOM object and view the XMLDOM's subtrees as tables
merged with the DataSet object's tables.
The .NET Framework XML API
The essence of XML in the .NET Framework is found in two abstract classes—
XmlReader and XmlWriter. These classes are at the core of all other .NET Framework
XML classes, including the XMLDOM classes, and are used extensively by various
subsystems to parse or generate XML text. For example, ADO.NET data adapters
retrieve the data to store in a DataSet object using a database reader, and the DataSet
object serializes its contents to the DiffGram format using an XmlTextWriter object,
which derives from XmlWriter
The XML API for the .NET Framework comprises the following set of functionalities:
1. XML readers
2. XML writers
3. XML document classes
Streams can be read and written using made-to-measure
reader and writer classes.
The base classes are TextReader, TextWriter, BinaryReader, BinaryWriter, and
Stream. With the exception of the binary classes, all of these classes are marked as
abstract (MustInherit, if you speak Visual Basic) and cannot be directly instantiated in
code. You can use abstract classes to reference living instances of derived classes,
however.
In the .NET Framework, base reader and writer classes find a number of concrete
implementations, including StreamReader and StringReader and their writing
counterparts.
XML Readers
An XML reader makes externally available a programming interface through which
callers can connect and pull out all the data they need. This is in no way different from
what happens when you connect to a database and fetch data. The database server
returns a reference to an internal object—the cursor—which manages all the query
results and makes them available on demand. This statement applies regardless of the
fact that the database world might provide several flavors of cursors—client, scrollable,
server-side, and so on.
Readers vs. XMLDOM
XML readers don't require you to keep more data in memory than you actually need.
When you open the XML document, a simple logical pointer that corresponds to a node
is returned. You can easily skip over nodes to locate the one you need. In doing so, you
don't tax in any way the application's memory with extra data other than that required to
bufferize the currently selected node.
Readers vs. SAX
A SAX parser directly controls the evolution of the parsing process and pushes data to
the client application. A cursor parser (that is, an XML reader), on the other hand, plays
a more passive role and leaves client applications to control the process
XML Writers
The .NET XML API separates parsing from editing and writing and offers a set of
methods that provides effective results for performance as well as usability. When
writing, you create new XML documents working at a considerably high level of
abstraction and explicitly indicate the XML elements to create—nodes, attributes,
comments, or processing instructions. The writer works on a stream, dumping content
incrementally, one node after the next, without the random access capabilities of the
XMLDOM but also without its memory footprint.
The XML Document Object API in .NET
As mentioned, along with XML readers and writers, the .NET Framework also provides
classes that load and edit XML documents according to the W3C DOM Level 1 and
Level 2 Core. The key XMLDOM class in the .NET Framework is XmlDocument—not
much different from the DOMDocument class, which you might recognize from working
with MSXML
XPath Expressions and XSLT
In the .NET Framework, XSLT and XPath expressions are fully supported but are
implemented in classes distinct from those that parse and write XML text. This is a key
feature of the overall .NET XML API. Any functionality is provided through a small
hierarchy of objects, although each subtree connects and interoperates well with
others.
The XMLDOM API is built on top of readers and writers, but both XSLT and
XPath expressions need to have a complete and XMLDOM-based vision of the entire XML
document to process it.
XML readers and writers are the primitive elements of the .NET XML API. Whenever
XML text must be parsed or written, all classes, directly or indirectly, refer to them. A
more complex primitive element is the XMLDOM tree. Transformations and advanced
queries must rely on the document in its entirety being held in memory and accessible
through a well-known interface—the XMLDOM.
The XSLT Processor
The key class for XSLT is XslTransform. The class works as an XSLT processor and
complies with version 1.0 of the XSLT recommendation. The class has two key
methods, Load and Transform, whose behavior is for the most part selfexplanatory
The XPath Query Engine
XPath is a language that allows you to navigate within XML documents. Think of XPath
as a general-purpose query language for addressing, sorting, and filtering both the
elements and the text of an XML document.
Further Reading
Further Reading
1.The W3C organization is currently working on a draft of the DOM Level 3 Core to
include support for an abstract modeling schema and I/O serialization. Check out the
most recent draft at http://www.w3.org/TR/2002/WD-DOM-Level3-ASLS-20020409. The
approved standard—DOM Level 2 Core—is available at http://www.w3.org/TR/DOMLevel-
2.Relevant information about XML standards is available from the W3C Web site, at
http://www.w3.org. If you want to learn more about the SAX specification, look at the
new Web site for the SAX project, at http://www.saxproject.org.

More Related Content

What's hot

Working with xml data
Working with xml dataWorking with xml data
Working with xml dataaspnet123
 
Xml data transformation
Xml data transformationXml data transformation
Xml data transformationRaghu nath
 
Web data management (chapter-1)
Web data management (chapter-1)Web data management (chapter-1)
Web data management (chapter-1)
Dhaval Asodariya
 
Xml programming language myassignmenthelp.net
Xml programming  language myassignmenthelp.netXml programming  language myassignmenthelp.net
Xml programming language myassignmenthelp.net
www.myassignmenthelp.net
 
Web data management
Web data managementWeb data management
Web data management
Abdul Hannan
 
Day Of Dot Net Ann Arbor 2007
Day Of Dot Net Ann Arbor 2007Day Of Dot Net Ann Arbor 2007
Day Of Dot Net Ann Arbor 2007
David Truxall
 
MarcEdit Shelter-In-Place Webinar 8: Automated editing through scripts and to...
MarcEdit Shelter-In-Place Webinar 8: Automated editing through scripts and to...MarcEdit Shelter-In-Place Webinar 8: Automated editing through scripts and to...
MarcEdit Shelter-In-Place Webinar 8: Automated editing through scripts and to...
Terry Reese
 
Slides from the NASIG 2018 Preconference
Slides from the NASIG 2018 PreconferenceSlides from the NASIG 2018 Preconference
Slides from the NASIG 2018 Preconference
Terry Reese
 
Understanding C# in .NET
Understanding C# in .NETUnderstanding C# in .NET
Understanding C# in .NET
mentorrbuddy
 
Python xml processing
Python   xml processingPython   xml processing
Python xml processing
Learnbay Datascience
 
ASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NETASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NET
Randy Connolly
 
Xml iet 2015
Xml iet 2015Xml iet 2015
Xml iet 2015
kiransurariya
 
PHP XML
PHP XMLPHP XML
PHP XML
YellGhost
 
Jaxp Xmltutorial 11 200108
Jaxp Xmltutorial 11 200108Jaxp Xmltutorial 11 200108
Jaxp Xmltutorial 11 200108
nit Allahabad
 
AAC Room
AAC RoomAAC Room
AAC Room
선옥 장
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
neeta1995
 
Data Persistence in Android with Room Library
Data Persistence in Android with Room LibraryData Persistence in Android with Room Library
Data Persistence in Android with Room Library
Reinvently
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xmlsoumya
 
Xml applications
Xml applicationsXml applications
Xml applications
Nabahat Tahir
 

What's hot (20)

Working with xml data
Working with xml dataWorking with xml data
Working with xml data
 
XML
XMLXML
XML
 
Xml data transformation
Xml data transformationXml data transformation
Xml data transformation
 
Web data management (chapter-1)
Web data management (chapter-1)Web data management (chapter-1)
Web data management (chapter-1)
 
Xml programming language myassignmenthelp.net
Xml programming  language myassignmenthelp.netXml programming  language myassignmenthelp.net
Xml programming language myassignmenthelp.net
 
Web data management
Web data managementWeb data management
Web data management
 
Day Of Dot Net Ann Arbor 2007
Day Of Dot Net Ann Arbor 2007Day Of Dot Net Ann Arbor 2007
Day Of Dot Net Ann Arbor 2007
 
MarcEdit Shelter-In-Place Webinar 8: Automated editing through scripts and to...
MarcEdit Shelter-In-Place Webinar 8: Automated editing through scripts and to...MarcEdit Shelter-In-Place Webinar 8: Automated editing through scripts and to...
MarcEdit Shelter-In-Place Webinar 8: Automated editing through scripts and to...
 
Slides from the NASIG 2018 Preconference
Slides from the NASIG 2018 PreconferenceSlides from the NASIG 2018 Preconference
Slides from the NASIG 2018 Preconference
 
Understanding C# in .NET
Understanding C# in .NETUnderstanding C# in .NET
Understanding C# in .NET
 
Python xml processing
Python   xml processingPython   xml processing
Python xml processing
 
ASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NETASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NET
 
Xml iet 2015
Xml iet 2015Xml iet 2015
Xml iet 2015
 
PHP XML
PHP XMLPHP XML
PHP XML
 
Jaxp Xmltutorial 11 200108
Jaxp Xmltutorial 11 200108Jaxp Xmltutorial 11 200108
Jaxp Xmltutorial 11 200108
 
AAC Room
AAC RoomAAC Room
AAC Room
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
 
Data Persistence in Android with Room Library
Data Persistence in Android with Room LibraryData Persistence in Android with Room Library
Data Persistence in Android with Room Library
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
Xml applications
Xml applicationsXml applications
Xml applications
 

Viewers also liked

P Training Presentation
P Training PresentationP Training Presentation
P Training PresentationGaurav Tyagi
 
Xml 215-presentation
Xml 215-presentationXml 215-presentation
Xml 215-presentation
Manish Chaurasia
 
Xml Presentation-3
Xml Presentation-3Xml Presentation-3
Xml Presentation-3Sudharsan S
 
Xml Presentation-1
Xml Presentation-1Xml Presentation-1
Xml Presentation-1Sudharsan S
 
XML.ppt
XML.pptXML.ppt
XML.pptbutest
 
XML Schema
XML SchemaXML Schema
XML Schema
Kumar
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
Gtu Booker
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XMLyht4ever
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
Jussi Pohjolainen
 
Xml ppt
Xml pptXml ppt
Xml ppt
seemadav1
 
XML - What is XML?
XML - What is XML?XML - What is XML?
XML - What is XML?sandur
 

Viewers also liked (15)

XML Schemas
XML SchemasXML Schemas
XML Schemas
 
P Training Presentation
P Training PresentationP Training Presentation
P Training Presentation
 
Xml 215-presentation
Xml 215-presentationXml 215-presentation
Xml 215-presentation
 
Xml Presentation-3
Xml Presentation-3Xml Presentation-3
Xml Presentation-3
 
Web Services
Web ServicesWeb Services
Web Services
 
Xml Presentation-1
Xml Presentation-1Xml Presentation-1
Xml Presentation-1
 
Web Services
Web ServicesWeb Services
Web Services
 
XML.ppt
XML.pptXML.ppt
XML.ppt
 
Xml
XmlXml
Xml
 
XML Schema
XML SchemaXML Schema
XML Schema
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Xml ppt
Xml pptXml ppt
Xml ppt
 
XML - What is XML?
XML - What is XML?XML - What is XML?
XML - What is XML?
 

Similar to Applied xml programming for microsoft

Xml and xml processor
Xml and xml processorXml and xml processor
Xml and xml processor
Himanshu Soni
 
Oracle soa xml faq
Oracle soa xml faqOracle soa xml faq
Oracle soa xml faq
xavier john
 
uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2
Abhishek Kesharwani
 
Xml serialization
Xml serializationXml serialization
Xml serializationRaghu nath
 
Linq to xml
Linq to xmlLinq to xml
Linq to xml
Mickey
 
Xml viva questions
Xml viva questionsXml viva questions
Xml viva questions
Vipul Naik
 
eXtensible Markup Language
eXtensible Markup LanguageeXtensible Markup Language
eXtensible Markup LanguageAditya Raj
 
XML1.pptx
XML1.pptxXML1.pptx
Ch23 xml processing_with_java
Ch23 xml processing_with_javaCh23 xml processing_with_java
Ch23 xml processing_with_java
ardnetij
 
XML
XMLXML
XML
XMLXML
XML
eewiley
 
XML Introduction
XML IntroductionXML Introduction
XML Introduction
Bikash chhetri
 
CTDA Workshop on XML and MODS
CTDA Workshop on XML and MODSCTDA Workshop on XML and MODS
CTDA Workshop on XML and MODS
University of Connecticut Libraries
 
XML Tutor maXbox starter27
XML Tutor maXbox starter27XML Tutor maXbox starter27
XML Tutor maXbox starter27
Max Kleiner
 

Similar to Applied xml programming for microsoft (20)

Xml and xml processor
Xml and xml processorXml and xml processor
Xml and xml processor
 
Oracle soa xml faq
Oracle soa xml faqOracle soa xml faq
Oracle soa xml faq
 
Unit 2.3
Unit 2.3Unit 2.3
Unit 2.3
 
uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2
 
Xml serialization
Xml serializationXml serialization
Xml serialization
 
Unit 2.3
Unit 2.3Unit 2.3
Unit 2.3
 
Linq to xml
Linq to xmlLinq to xml
Linq to xml
 
Xml viva questions
Xml viva questionsXml viva questions
Xml viva questions
 
eXtensible Markup Language
eXtensible Markup LanguageeXtensible Markup Language
eXtensible Markup Language
 
XML1.pptx
XML1.pptxXML1.pptx
XML1.pptx
 
Xml3
Xml3Xml3
Xml3
 
Xml3
Xml3Xml3
Xml3
 
Ch23
Ch23Ch23
Ch23
 
Ch23 xml processing_with_java
Ch23 xml processing_with_javaCh23 xml processing_with_java
Ch23 xml processing_with_java
 
XML
XMLXML
XML
 
XML
XMLXML
XML
 
XML Introduction
XML IntroductionXML Introduction
XML Introduction
 
CTDA Workshop on XML and MODS
CTDA Workshop on XML and MODSCTDA Workshop on XML and MODS
CTDA Workshop on XML and MODS
 
The xml
The xmlThe xml
The xml
 
XML Tutor maXbox starter27
XML Tutor maXbox starter27XML Tutor maXbox starter27
XML Tutor maXbox starter27
 

More from Raghu nath

Mongo db
Mongo dbMongo db
Mongo db
Raghu nath
 
Ftp (file transfer protocol)
Ftp (file transfer protocol)Ftp (file transfer protocol)
Ftp (file transfer protocol)
Raghu nath
 
Javascript part1
Javascript part1Javascript part1
Javascript part1Raghu nath
 
Regular expressions
Regular expressionsRegular expressions
Regular expressionsRaghu nath
 
Selection sort
Selection sortSelection sort
Selection sortRaghu nath
 
Binary search
Binary search Binary search
Binary search Raghu nath
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)Raghu nath
 
Stemming algorithms
Stemming algorithmsStemming algorithms
Stemming algorithmsRaghu nath
 
Step by step guide to install dhcp role
Step by step guide to install dhcp roleStep by step guide to install dhcp role
Step by step guide to install dhcp roleRaghu nath
 
Network essentials chapter 4
Network essentials  chapter 4Network essentials  chapter 4
Network essentials chapter 4Raghu nath
 
Network essentials chapter 3
Network essentials  chapter 3Network essentials  chapter 3
Network essentials chapter 3Raghu nath
 
Network essentials chapter 2
Network essentials  chapter 2Network essentials  chapter 2
Network essentials chapter 2Raghu nath
 
Network essentials - chapter 1
Network essentials - chapter 1Network essentials - chapter 1
Network essentials - chapter 1Raghu nath
 
Python chapter 2
Python chapter 2Python chapter 2
Python chapter 2Raghu nath
 
python chapter 1
python chapter 1python chapter 1
python chapter 1Raghu nath
 
Linux Shell Scripting
Linux Shell ScriptingLinux Shell Scripting
Linux Shell ScriptingRaghu nath
 

More from Raghu nath (20)

Mongo db
Mongo dbMongo db
Mongo db
 
Ftp (file transfer protocol)
Ftp (file transfer protocol)Ftp (file transfer protocol)
Ftp (file transfer protocol)
 
MS WORD 2013
MS WORD 2013MS WORD 2013
MS WORD 2013
 
Msword
MswordMsword
Msword
 
Ms word
Ms wordMs word
Ms word
 
Javascript part1
Javascript part1Javascript part1
Javascript part1
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Selection sort
Selection sortSelection sort
Selection sort
 
Binary search
Binary search Binary search
Binary search
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)
 
Stemming algorithms
Stemming algorithmsStemming algorithms
Stemming algorithms
 
Step by step guide to install dhcp role
Step by step guide to install dhcp roleStep by step guide to install dhcp role
Step by step guide to install dhcp role
 
Network essentials chapter 4
Network essentials  chapter 4Network essentials  chapter 4
Network essentials chapter 4
 
Network essentials chapter 3
Network essentials  chapter 3Network essentials  chapter 3
Network essentials chapter 3
 
Network essentials chapter 2
Network essentials  chapter 2Network essentials  chapter 2
Network essentials chapter 2
 
Network essentials - chapter 1
Network essentials - chapter 1Network essentials - chapter 1
Network essentials - chapter 1
 
Python chapter 2
Python chapter 2Python chapter 2
Python chapter 2
 
python chapter 1
python chapter 1python chapter 1
python chapter 1
 
Linux Shell Scripting
Linux Shell ScriptingLinux Shell Scripting
Linux Shell Scripting
 
Perl
PerlPerl
Perl
 

Recently uploaded

Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
AzmatAli747758
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 

Recently uploaded (20)

Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 

Applied xml programming for microsoft

  • 2. The .NET XML Parsing Model 1. XML is a natural element of all forms of programming life. 2. XML in the .NET Framework The .NET Framework XML core classes can be categorized according to their functions: 1. reading and writing documents 2. validating documents 3. navigating and selecting nodes 4. managing schema information 5. performing document transformations
  • 3. The assembly in which the whole XML .NET Framework is implemented is system.xml.dll The most commonly used namespaces are listed here: 1. System.Xml 2. System.Xml.Schema 3. System.Xml.XPath 4. System.Xml.Xsl
  • 4. The .NET Framework also provides for XML object serialization. The classes involved with this functionality are grouped in the System.Xml.Serialization namespace. XML serialization writes objects to, and reads them from, XML documents. This kind of serialization is particularly useful over the Web in combination with the Simple Object Access Protocol (SOAP) and within the boundaries of .NET Framework XML Web services.
  • 5. Areas of the .NET Framework in Which XML Is Key Category Description ADO.NET Data container objects (for example, the DataSet object) are always transferred and remoted via XML Configuration Application settings are stored in XML files, making use of predefined and user-defined section readers. Remoting Remote .NET Framework objects can be accessed by using SOAP packets to prepare and perform the call. Web services SOAP is a lightweight XML protocol that Web services use for the exchange of information in a decentralized, distributed environment.
  • 6. XML parsing The core classes providing for XML parsing and manipulation through both the stream-based API and the XML Document Object Model (XMLDOM). XML serialization Supplies the ability to save and restore living instances of objects to and from XML documents
  • 7. Classes for Parsing The available XML parsers fall into one of two main categories: 1. tree-based parsers 2. event-based parsers
  • 8. XML and ADO.NET The interaction between ADO.NET classes and XML documents takes one of two forms: Serialization of ADO.NET objects (in particular, the DataSet object) to XML documents and corresponding deserialization. Data can be saved to XML in a variety of formats, with or without schema information, as a full snapshot of the in-memory data including pending changes and errors, or with just the current instance of the data
  • 9. A dual-access model that lets you access and update the same piece of data either through a hierarchical programming interface or using the ADO.NET relational API. Basically, you can transform a DataSet object into an XMLDOM object and view the XMLDOM's subtrees as tables merged with the DataSet object's tables.
  • 10. The .NET Framework XML API The essence of XML in the .NET Framework is found in two abstract classes— XmlReader and XmlWriter. These classes are at the core of all other .NET Framework XML classes, including the XMLDOM classes, and are used extensively by various subsystems to parse or generate XML text. For example, ADO.NET data adapters retrieve the data to store in a DataSet object using a database reader, and the DataSet object serializes its contents to the DiffGram format using an XmlTextWriter object, which derives from XmlWriter
  • 11. The XML API for the .NET Framework comprises the following set of functionalities: 1. XML readers 2. XML writers 3. XML document classes
  • 12.
  • 13. Streams can be read and written using made-to-measure reader and writer classes. The base classes are TextReader, TextWriter, BinaryReader, BinaryWriter, and Stream. With the exception of the binary classes, all of these classes are marked as abstract (MustInherit, if you speak Visual Basic) and cannot be directly instantiated in code. You can use abstract classes to reference living instances of derived classes, however. In the .NET Framework, base reader and writer classes find a number of concrete implementations, including StreamReader and StringReader and their writing counterparts.
  • 14. XML Readers An XML reader makes externally available a programming interface through which callers can connect and pull out all the data they need. This is in no way different from what happens when you connect to a database and fetch data. The database server returns a reference to an internal object—the cursor—which manages all the query results and makes them available on demand. This statement applies regardless of the fact that the database world might provide several flavors of cursors—client, scrollable, server-side, and so on.
  • 15. Readers vs. XMLDOM XML readers don't require you to keep more data in memory than you actually need. When you open the XML document, a simple logical pointer that corresponds to a node is returned. You can easily skip over nodes to locate the one you need. In doing so, you don't tax in any way the application's memory with extra data other than that required to bufferize the currently selected node.
  • 16. Readers vs. SAX A SAX parser directly controls the evolution of the parsing process and pushes data to the client application. A cursor parser (that is, an XML reader), on the other hand, plays a more passive role and leaves client applications to control the process
  • 17. XML Writers The .NET XML API separates parsing from editing and writing and offers a set of methods that provides effective results for performance as well as usability. When writing, you create new XML documents working at a considerably high level of abstraction and explicitly indicate the XML elements to create—nodes, attributes, comments, or processing instructions. The writer works on a stream, dumping content incrementally, one node after the next, without the random access capabilities of the XMLDOM but also without its memory footprint.
  • 18. The XML Document Object API in .NET As mentioned, along with XML readers and writers, the .NET Framework also provides classes that load and edit XML documents according to the W3C DOM Level 1 and Level 2 Core. The key XMLDOM class in the .NET Framework is XmlDocument—not much different from the DOMDocument class, which you might recognize from working with MSXML
  • 19. XPath Expressions and XSLT In the .NET Framework, XSLT and XPath expressions are fully supported but are implemented in classes distinct from those that parse and write XML text. This is a key feature of the overall .NET XML API. Any functionality is provided through a small hierarchy of objects, although each subtree connects and interoperates well with others.
  • 20.
  • 21. The XMLDOM API is built on top of readers and writers, but both XSLT and XPath expressions need to have a complete and XMLDOM-based vision of the entire XML document to process it. XML readers and writers are the primitive elements of the .NET XML API. Whenever XML text must be parsed or written, all classes, directly or indirectly, refer to them. A more complex primitive element is the XMLDOM tree. Transformations and advanced queries must rely on the document in its entirety being held in memory and accessible through a well-known interface—the XMLDOM.
  • 22. The XSLT Processor The key class for XSLT is XslTransform. The class works as an XSLT processor and complies with version 1.0 of the XSLT recommendation. The class has two key methods, Load and Transform, whose behavior is for the most part selfexplanatory
  • 23. The XPath Query Engine XPath is a language that allows you to navigate within XML documents. Think of XPath as a general-purpose query language for addressing, sorting, and filtering both the elements and the text of an XML document.
  • 24. Further Reading Further Reading 1.The W3C organization is currently working on a draft of the DOM Level 3 Core to include support for an abstract modeling schema and I/O serialization. Check out the most recent draft at http://www.w3.org/TR/2002/WD-DOM-Level3-ASLS-20020409. The approved standard—DOM Level 2 Core—is available at http://www.w3.org/TR/DOMLevel- 2.Relevant information about XML standards is available from the W3C Web site, at http://www.w3.org. If you want to learn more about the SAX specification, look at the new Web site for the SAX project, at http://www.saxproject.org.