XML Tutorials - Herong's Tutorial Examples - Version 5.05, by Dr. Herong Yang
What is XPath (XML Path)?
This section provides a quick introduction of XPath (XML Path), which is an expression language to produce a value that represents sub structure of an XML document.
What Is XPath (XML Path)? XPath is an expression evaluation language to produce a value that represents sub structure of an XML document.
You can compare XPath with regular expression, which is an expression language to produce a value that represents sub structure of a text string.
You can compare XPath with the DOS path name convention, which is a simple expression language to produce a value that represents a sub structure of a file system.
Writing an XPath expression involves following aspects:
XPath is used currently in both XSLT and XPointer.
Here are some examples of XPath expressions:
. Representing the current node img Representing child elements named as "img" @color Representing the attribute named as "id" /html Representing the root element named as "html" p[1] Representing the first occurrence of child "p" elements p[@id=open] Representing child "p" elements with id="open" attribute
Last update: 2014.
Table of Contents
Introduction of XML (eXtensible Markup Language)
DOM (Document Object Model) Programming Interface
SAX (Simple API for XML) Programming Interface
DTD (Document Type Definition) Introduction
Validating an XML Document against the Specified DTD Document Type
XSD (XML Schema Definition) Introduction
Validating XML Documents Against Specified XML Schemas
XSL (Extensible Stylesheet Language) Introduction
XSLT (XSL Transformations) Introduction
Data Types, Literals and Variables
Expressions and Location Paths
XSLT Elements as Programming Statements
Control and Generate XML Element in the Result
XML Tools Plugin for Notepad++