TECHNOLOGY COURSES
XML Parsing Using C# and .NET
Course Description: This two-day course teaches the different types of XML parsing available in .NET. It covers the different parsing methodologies available from Microsoft and gives an overview of XML technologies in the .NET Framework. Both the streaming model of XmlReader and XmlWriter and the Document Object Model (DOM) are covered in detail. Validation using DTD and XmlSchema is discussed. New features in System.Xml in .NET 2.0 are discussed in the context of where the topics are covered. Visual Studio 2005 is used as the development environment.
Audience: XML programmers who need to modify, create, and delete information in an XML document using the .NET DOM classes, and handle XML parsing exceptions.
Prerequisites: Ability to read and to write well-formed XML. A working knowledge of programming the .NET Framework using C#.
Days: 2
Course Contents
.NET Framework XML Overview
- XML
- Parsing XML
- Using XML in .NET Applications
- The .NET XML Classes
- Parsing Techniques
- .NET Parsing Techniques
- How Does SAX and MSXML Fit Into .NET?
- XmlReader and XmlWriter Features
- .NET DOM Parser Features
- Other XML Features in .NET
- XML and the Web
- Internet Explorer and XML
Reading XML Streams in .NET
- The .NET XmlReader Classes
- The XmlReader Properties
- Accessing Nodes
- Reading Attributes
- MoveToNextAttribute
- Using Streams with XmlTextReader
- Catching the Exceptions
- Moving Around the Document
- Handling Whitespace
- Parsing a Specific Document
- Parsing the Top-Level Elements
- Subroutines
- Looping for Children
- Text via Brute Force
- ReadElementString
- Zenith Courseware Case Study
- Miscellaneous Reading Methods
- Handling Namespaces
- The XmlNodeReader Class
- Creating XmlReaders in .NET 2.0
- Benefits of Using XmlReader.Create()
Validating XML Streams
- Valid XML
- The Trouble with Well-Formed XML
- Formal Type Information
- DTDs and XML Schema
- XML Schema for a Stereo System
- DTD and XML Schema Comparison
- Invalid XML
- A Validation Tool
- Creating Schema with Visual Studio
- Using the Schema Graphical Editor
- Validating XML Streams
- Validation Settings
- Validation Flags
- .NET Validation Code
- Validation Events
|
Writing XML Streams in .NET
- Writing XML in .NET
- The XmlWriter Class
- The XmlTextWriter Class
- The State of Writer
- Creating XmlWriters in .NET 2.0
- Writing Out Elements
- Writing Nested Elements
- Writing Attributes
The Document Object Model in .NET
- The Document Object Model (DOM)
- Origins of the DOM
- DOM2 Structure
- DOM Tree Model
- .NET DOM Classes
- The XmlDocument Class
- The XmlNode Class – Basic Parsing
- Polymorphic Node Types
- The XmlNode Class – Node Types
- Basic Parsing
- The XmlElement Class
- The XmlAttribute Class
- The XmlAttributeCollection Class
- The XmlText Class
- The XmlNodeList Class
- Using a foreach Loop
- Validation
Manipulating XML Information with the DOM
- Modifying Documents
- The XmlNode Class – Modifications
- Legal and Illegal Modifications
- Managing Children
- Cloning
- Modifying Elements
- Splitting Text and Normalizing
- Modifying Attributes
Appendix A - Zenith Courseware Case Study |
|
|