XML Tutorials - Herong's Tutorial Examples

https://www.herongyang.com/XML

Copyright © 1999-2024 Herong Yang. All rights reserved.

XML Tutorials This XML tutorial book is a collection of notes and sample codes written by the author while he was learning XML himself. Topics include introduction to XML, DTD (Document Type Definition), XSD (XML Schema Definition), XPath (XML Path Language), XSL (Extensible Stylesheet Language), XSLT (XSL Transformation), XSL-FO (Formatting Objects), DOM (Document Object Model), and SAX (Simple API for XML); viewing XML with Chrome, Firefox, Safari and IE Web browsers; XML tools with Notepad++ and Atom editors; generating and parsing XML with Java, PHP and Python programs; converting XML to and from JSON. Updated in 2024 (Version v5.25) with minor changes.

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 Google Chrome as an XML Browser

Using Google Chrome as an XML Syntax Checker

Using Mozilla Firefox as an XML Browser

Using Mozilla Firefox as an XML Syntax Checker

Using Apple Safari as an XML Browser

Using Apple Safari as an XML Syntax Checker

Using Microsoft Edge as an XML Browser

Using Microsoft Edge as an XML Syntax Checker

Using Internet Explorer as an XML Browser

Using Internet Explorer as an XML Syntax Checker

XML Spy and Other XML Browsers

XML-JSON Document Conversion

What Is JSON (JavaScript Object Notation)

Convert XML Document to JSON Document

XML-to-JSON Conversion Rules

XML-to-JSON Conversion Tool at onlinexmltools.com

XML-to-JSON Conversion Library for Java

XML-to-JSON Conversion Module for Python

Convert JSON Document to XML Document

JSON-to-XML Conversion Rules

JSON-to-XML Conversion Tool at onlinexmltools.com

JSON-to-XML Conversion Library for Java

JSON-to-XML Conversion Module for Python

DOM (Document Object Model) Programming Interface

What Is DOM (Document Object Model)

Using DOM Implementation Provided in JDK

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 in JDK

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 XML Documents Against Specified XML Schemas

XSD Schema Validator on XML DOM Object

XSD Schema Validator on XML DOM Object - Errors

XSD Schema Validator on XML SAX Object

SAXParseException - 'xsi:noNamespaceSchemaLocation' Not Allowed

Validating XML Linked with XSD using XMLReader

XSL (Extensible Stylesheet Language) Introduction

What Is XSL (Extensible Stylesheet Language)

"Hello world!" Example of XSLT

Web Browser Errors on Local XSL File

Java Implementation of XSLT

XSLT Implementations in JDK

XSLTransformer.java - A Simple XSLT Transformation Program

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

XPath (XML Path) Language

XSLT Elements as Programming Statements

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

PHP Extensions for XML Manipulation

Processing XML with Python Scripts

What Is the Python "xml" Package

xml.dom.minidom for Building XML Document

xml.dom.minidom for Parsing XML Document

xml.sax for Parsing XML Document

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

XML Plugin Packages for Atom Editor

XML Tools Package for Atom

XPath Query with XML Tools on Atom

atom-xsltransform Package for Atom

XML 1.1 Changes and Parsing Examples

Major Changes in XML 1.1

Supporting XML 1.1 in Java and Higher

Control Codes Supported in XML 1.1

Unicode Characters Supported in XML 1.1 Names

End-of-Line Characters Supported in XML 1.1

Web Browsers Not Supporting XML 1.1

Archived Tutorials

Archived: Downloading and Installing Notepad++ 6.8

Archived: Downloading and Installing Notepad++ 5.9

Archived: Using DOM Implementation Provided in JDK 1.4

Archived: Using SAX Implementation Provided in JDK 1.4

References

Full Version in PDF/EPUB

Keywords: XML, Markup, Language, Tutorial, Book