XML Tutorials - Herong's Tutorial Examples
Dr. Herong Yang, Version 4.10

XML Tutorials - Herong's Tutorial Examples

http://www.herongyang.com/XML

Copyright © 2013 by Dr. Herong Yang. All rights reserved.

HerongYang.com This free XML tutorial book is a collection of notes and sample codes written by the author while he was learning XML himself, an ideal tutorial guide for beginners. Topics include DOM, DTD, J2SDK, Java, SAX, Syntax, Templates, XML, XPath, XSD, XSL, XSLT, XSL-FO.

Table of Contents

About This Book

Introduction of XML (eXtensible Markup Language)

What Is XML?

Main Features of XML

XML File Syntax

Types of Information in XML Files

XML File Syntax Rules

The <?xml ...?> Processing Instruction

dictionary.xml - A Simple XML Sample File

XML File Browsers

Using Internet Explorer as an XML Browser

Using Internet Explorer as an XML Syntax Checker

Using Mozilla Firefox as an XML Browser

Using Mozilla Firefox as an XML Syntax Checker

XML Spy and Other XML Browsers

DOM (Document Object Model) Programming Interface

What Is DOM (Document Object Model)?

Using DOM Implementation Provided in JDK 1.4

DOM Specifications and DOM Node Interface

DOMBrowser.java - DOM Interface Java Example

XML DOM Node Tree Example

Building a New DOM Document Object

Converting DOM Document Objects to XML Files

SAX (Simple API for XML) Programming Interface

What Is SAX (Simple API for XML)?

Using SAX Implementation Provided in JDK 1.4

SAX Content Handler Interface

SAXBrowser.java - SAX Interface Java Example

SAX Parsing Pattern Example

DTD (Document Type Definition) Introduction

What Is DTD (Document Type Definition)?

XML Files with Embedded DTD Statements

XML Files with Linked External DTD Files

Validating an XML File against a DTD Document Type

Syntaxes of DTD Statements

DOCTYPE - Document Type Declaration Statement

ELEMENT - Element Declaration Statement

ATTLIST - Attribute List Declaration Statement

ENTITY - Entity Declaration Statement

dictionary_dtd.xml - XML DTD Document Type Example

Validating an XML Document against the Specified DTD Document Type

DOMValidator.java - Validating XML with DTD using DOM

SAXValidator.java - Validating XML with DTD using SAX

XSD (XML Schema Definition) Introduction

What Is XSD (XML Schema Definition)?

XML Files with Embedded XSD Statements

XML Files with Linked External XSD Files

Validating an XML File against a XSD Schema

Syntaxes of XSD Statements

"schema" - The Schema Declaration Statement

"element" - The Element Declaration Statement

Simple Element Types with Built-in Data Types

Simple Element Types with Extended Data Types

Complex Element Types

Simple Content Element Types

Empty Element Types

Anonymous or Inline Data Types

dictionary.xsd - A Sample XSD XML Schema File

Validating an XML Document against the Specified XML Schema

XMLReaderValidator.java - Validating XML with XSD using Xerces-J

XMLReaderValidator.java - Validation Error Messages

Using SAXParserFactory to Load XML Parsers

XSL (Extensible Stylesheet Language) Introduction

What Is XSL (Extensible Stylesheet Language)?

"Hello world!" Example of XSLT

XSLT (XSL Transformations) Introduction

What Is XSLT (XSL Transformations)?

"stylesheet" - The Stylesheet Declaration Element

"template" - The Template Declaration Element

Including Literal XML Elements in Templates

"apply-templates" - The Child Transformation Call Element

How the Transformation Process Gets Started?

Default Transformation Template

XML Element Transformation Chains

XML Element Transformation Chains - Complex Example

Java Implementation of XSLT

XSLT Implementations in JDK 1.4

XSLTransformer.java - A Simple XSLT Transformation Program

XPath (XML Path) Language

What is XPath (XML Path)?

Data Types, Literals and Variables

Evaluation Context

Built-in Functions

Expressions and Location Paths

Using XPath in XSLT Templates

XSLT Elements as Programming Statements

"value-of" - Evaluating XPath String Expressions

Examples of Using "value-of" Elements

"{expression}" - Shorthand of "value-of" Elements

"variable" - Declaring Variables

"for-each" - Looping through a Node Set

Examples of Using "for-each" Elements

"if" - The Conditional Element

"choose" - The If...Else Element

Control and Generate XML Element in the Result

"output" - The Output Format Control Element

Generating Transformation Output in XML Format

"element" and "attribute" - Constructing Output Elements

"copy" - Copy Elements from Source to Result

Copying Attributes and Texts

XML Notepad - XML Editor

What Is XML Notepad?

Downloading and Installing XML Notepad

Creating XML Documents in Tree View

Viewing XML Documents in Source Code

Converting XML in Pretty Print Format

XSD Validation and Error List

XSLT Transformation and HTML View

XML Tools Plugin for Notepad++

What Is XML Tools Plugin for Notepad++

Downloading and Installing Notepad++ with XML Tools

Converting XML in Pretty Print Format

XSD Validation and Error List

XSLT Transformation

Other XML Tools Functions

References

Printable Copy - PDF Version

Keywords: XML, Markup, Language, Tutorial, Book

Dr. Herong Yang, updated in 2013
Table of Contents