Institute for Advanced Professional Studies

XML Parsing Using C# and .NET

XML Parsing Course Overview:

This two-day, hands-on course enables participants to write programs that retrieve, modify, and delete XML data in the most effective way, use the .NET System.Xml DOM classes, develop XML applications in .NET, and select the best parsing method to meet an application program's requirements.

The different types of XML parsing available for .NET application development are compared in detail, and the .NET Framework and XML classes found in the System namespace, are surveyed.

The course examines the different parsing methodologies available from Microsoft, presents an overview of XML technologies in the .NET Framework, and enables participants to use the .NET Framework classes for efficiently traversing XML streams. The course enables participants to apply the XMLReader classes and the many properties and methods available to create fast parsing applications.

The course details each of the Reader classes and discusses the differences between each, including XmlValidatingReader that enables the validation of an XML document for a DTD or a schema.

Participants use the XMLTextWriter class and the different methods available for creating an XML stream and sending it to another application. The Document Object Model (DOM) specified by the World Wide Web Consortium is reviewed in detail.

Numerous programming examples and exercises are provided, including a fully-developed case study that illustrates the use of XML in an eCommerce application. Participants will receive a comprehensive set of materials, including detailed course notes and soft copy of all the programming examples and lab exercises.

Related courses:

XML Workshop Objectives:

Upon successful completion of this course, participants will be able to:

  • Understand the purpose of the .NET Framework XML classes
  • Identify the .NET classes involved in parsing and creating XML documents
  • Handle XML parsing exceptions
  • Parse and validate XML data streams using XMLReader classes
  • Use the XMLTextWriter class to create XML data streams
  • Modify, create and delete information in an XML document using the .NET DOM classes

IAPS can customize XML, C# and .NET training to address specific project requirements and achieve organizational objectives.

Topic Outline:

  • .NET Framework XML Overview
    • Pure XML (How XML is Used in the .NET Framework)
    • Parsing XML
    • Core .NET Namespaces
    • .NET XML Classes
    • The Tradeoffs of Pull/Push and Cached/Non-cached Parsers
    • How the MSXML Fits in .NET
    • What the W3C Says
    • What the W3C Does Not Say
    • .NET XmlReader and XmlWriter Features
    • .NET DOM Parser Features

  • The Reading XML Streams in .NET
    • XML Document Streams
    • The XmlTextReader Class
    • Accessing Node Properties with the .NET XML Classes
    • Traversing the XML Document
    • Catching XMLExceptions
    • Accessing Attribute Values
    • The XmlNodeReader and XmlNodeValidatingReader Classes

  • Writing XML Streams in .NET
    • The XmlWriter Class
    • Four Steps for Creating the XML Document
    • Common Settings for XML Document Streams
    • The XmlTextWriter WriteXXX Methods
    • Writing Elements
    • Writing Attributes
    • Writing Namespaces
    • Serializing Objects into XML

  • The Document Object Model in .NET
    • Origins of the DOM
    • DOM Levels
    • DOM2 Structure
    • The XmlDocument Class
    • DOM Tree Model
    • DOM Interfaces
    • XmlDocument, XmlNode and XmlNodeList Classes
    • XmlElement and XmlText Interfaces
    • Finding Elements by Name
    • Walking the Child List
    • The XmlAttribute Interface
    • Namespaces and the DOM
    • Error Handling
    • The ProcessingInstruction Interface
    • The DOM and the XML InfoSet
    • Object Serialization with the DOM

  • Manipulating XML Information with the .NET DOM
    • Modifying Documents
    • Modifying Elements
    • Modifying Attributes
    • Managing Children
    • Cloning
    • Splitting Text and Normalizing
    • Creating New Documents
    • Object Persistence with the DOM
    • Adapting Object Models to the DOM

  • Appendix A: Learning Resources
  • Appendix B: Core XML: Learning Resources
  • Appendix C: Core XML: Quick Reference -- XML and DTD Grammar


2 days

Intended Audience:

The course is for experienced C# programmers who wish to become competent at parsing XML in a .NET environment.

Technical Prerequisites:

Participants should be able to read and write well-formed XML and to read a DTD. A working knowledge of C# programming in the .NET Framework is required.

Course Format:

Hands-on lecture/workshop

© Copyright 2004-2015 Institute for Advanced Professional Studies (IAPS)