image description

Programming with XML in the Microsoft .NET Framework

Register Now 

Length: 3 days   Fee: $1,495   Course #: 2663

Course Description

This three-day instructor-led his course teaches developers how to program with XML in the Microsoft .NET Framework in order to build Microsoft Windows or Web-based integrated applications that are easier to build, scalable, and flexible.

Course Objectives:

After completing this course, students will be able to:

Explain how XML is integrated into the .NET Framework and the classes associated with XML in the .NET Framework.

Parse and read XML in the .NET Framework.

Write and validate an XML document.

Manipulate cached XML documents in memory.

Query XML documents.

Transform XML documents.

Create new XML schemas programmatically.

Course Audience:

This course is intended for:

Programmers who build Web-based or Windows applications that access data

Programmers who build Web services

Programmers who build applications that access data stored as XML

This course is not recommended for developers who:

Want to learn a programming language, such as Microsoft Visual Basic .NET or Microsoft Visual C#

Want an introduction to XML and related technologies

Want advanced-level information on developing XML-based applications

Want to learn how to program by using Microsoft XML Core Services (MSXML), or how to program with XML in Microsoft Internet Explorer 6.0

Course PreRequisites:

Before attending this course, students must have:

Experience with programming languages such as Visual Basic .NET or Microsoft Visual C#.

Experience using the Microsoft Visual Studio .NET developer environment.

Experience building applications using the Extensible Stylesheet Language for Transformation (XSLT), XML Path Language (XPath), and XML schemas.

Course Outline:

Module 1: Introduction to XML in the .NET Framework

 

This module introduces the use of XML in the .NET Framework to help you solve common business problems. XML is a standards-driven technology that is ideal for applications that use the Internet. Microsoft's implementation of World Wide Web Consortium (W3C) standards ensures that applications you develop with XML in .NET will successfully communicate with other W3C-compatible applications

Lessons

Overview

Course at a Glance

Common Business Problems

XML in the .NET Framework

After completing this module, students will be able to:

Explain how XML provides solutions to common business problems.

Discuss how Microsoft's implementation of W3C standards for XML provides a framework for XML solutions to business problems.

Diagram XML support in the .NET Framework.


Module 2: Parsing XML

Take a closer look: Download Sample Module 2 (Portable Document Format, 990 KB).

This module discusses how to parse XML data from a file, string, or stream by using the XmlReader class. It also covers how to use the XmlTextReader to process XML as text, and how to use the XmlNodeReader to filter data by using an XPath expression and the object.

Lessons

Overview of XML Parsing

Parsing XML Using XmlTextReader

Creating a Custom Reader

Lab 2.1: Parsing XML

Exercise 1: Building an XML Web Service to Parse XML

After completing this module, students will be able to:

Create a Stream object from an XML file.

Build a mutable string by using the StringBuilder object.

Handle errors in the form of XML.

Parse XML as text by using the XmlTextReader object.

Create a custom XmlReader object.

Module 3: Validating XML

This module gives an overview of XML Schema Definition (XSD) data types, and then covers how to use the Microsoft .NET Framework XML classes to perform XML schema validation. The lesson Advanced Validation teaches how to resolve external entities, how to validate XML fragments, and how to validate XML by using a Document Type Definition (DTD).

Lessons

Examining Schemas

Validating XML While Parsing

Advanced Validation

Lab 3.1: Validating XML

Exercise 1: Extend an XML Web Service to Validate XML

After completing this module, students will be able to:

Instantiate an XML validating reader.

Associate one or more XML schemas with an XML validating reader.

Handle errors that result when a validating reader processes invalid XML.

Create an application that uses the .NET Framework XML classes and XML schemas to validate an XML fragment.

Resolve a Uniform Resource Identifier (URI) reference to a schema or DTD.

Create an application that uses the .NET Framework XML classes and an XSD schema or a DTD to validate well-formed XML.

Module 4: Writing XML

Writing XML is a central skill in developing XML-based applications. This module describes the .NET Framework classes that are used to write XML with or without namespaces. The module also explains how to control the format and validity of XML as it is being written.

Lessons

Overview of Generating XML Documents

Writing XML

Generating XML with Namespaces

Controlling XML Format and Converting XML

Lab 4.1: Writing XML

Exercise 1: Building an XML Web Service to Write XML

After completing this module, students will be able to:

Use the XmlTextWriter class to write well-formed XML.

Generate namespaces for elements and attributes.

Control indentation and other code format characteristics when generating XML.

Write XML that preserves characters that are normally represented by using escape characters.

Module 5: Querying XML

This module explains the process of querying an XML document by using XPath. It explains how to write code to load an XML document, and how to create a navigation cursor by using an XPathNavigator object. It also explains how to create your query by using an XPathDocument object, and how to examine the result types. In addition, this module describes how to compile your query and evaluate your results.

Lessons

Introduction to Querying XML Using XPath

Creating and Navigating a Document Cache

Executing Your Query

Lab 5.1: Querying XML Documents Using XPath

Exercise 1: Creating and Loading an XML Data Cache

Exercise 2: Compiling and Executing Queries That Return Nodes

Exercise 3: Compiling and Executing Queries That Return Numbers

Exercise 4: Compiling and Executing Queries That Return Strings

After completing this module, students will be able to:

Describe the business reasons for querying XML documents by using XPath.

Cache XML data for querying by using an XPathDocument object.

Create an XPathNavigator object to navigate through an XML document.

Compile and evaluate the result of an XPathExpression object.

Iterate through an XmlNodeList object returned by an XPath expression.

Module 6: Manipulating Cached XML

This module introduces the XML Document Object Model (XML DOM) and explains how to locate and manipulate XML by using the DOM.

Lessons

Introduction to the XML Document Object Model

Navigating XML Using the DOM

Creating New Nodes

Modifying and Deleting Nodes

Lab 6.1: Manipulating Cached XMLDocument Objects

Exercise 1: Loading an XML Document

Exercise 2: Navigating an XML Document

Exercise 3: Adding Elements and Comments to an XML Document

Exercise 4: Modifying and Deleting Information

After completing this module, students will be able to:

Open and save XML by using the DOM.

LocateXML by using the DOM.

Create nodes in the XML node tree.

Modify and delete nodes in the XML node tree.

Module 7: Transforming XML

This module explains the process of transforming XML documents. The module teaches the student how to apply an XSLT transformation to an XML document by using the .NET XML classes. It does not teach XSLT syntax or commands.

Lessons

Introduction to Transforming XML

Programmng the XslTransform Class

Extending XSLT Style Sheets

Lab 7.1: Transforming XML Documents

Exercise 1: Applying a Style Sheet

Exercise 2: Using Style Sheet Parameters

Exercise 3: Extending a Style Sheet with an Extension Object

After completing this module, students will be able to:

List the business use cases for using XSLT.

Describe the transformation process.

Apply style sheets to XML documents by using the XslTransform class.

Display XML by using the ASP.NET Xml Web Forms control.

Pass parameters to XSLT style sheets.

Apply a style sheet that references an extension object.

Module 8: Serializing Objects as XML

This module provides students with the skills needed to create XML documents from the data contained within programmatic objects. This process is referred to as serialization and can be used to persist object data or to share object data between applications.

Lessons

Introduction to XML Serialization

Serializing Objects Using XmlSerializer

Controlling XML Serialization

 

Lab 8.1: Serializing Objects as XML

Exercise 1: Serializing a Purchase Order

Exercise 2: Controlling Serialization with Attributes

Exercise 3: Deserializing an Invoice

After completing this module, students will be able to:

Define XML serialization.

Serialize and deserialize objects by using the XmlSerializer class.

Control XML serialization by using attributes.

Take a closer look: Download Sample Module 1 (Portable Document Format, 918 KB).

Register Now