XPath
XPath
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
What is XPath?
XPath is a major element in the XSLT standard.
These path expressions look very much like the path expressions you use with
traditional computer file systems:
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
There are functions for string values, numeric values, booleans, date and time
comparison, node manipulation, sequence manipulation, and much more.
Today XPath expressions can also be used in JavaScript, Java, XML Schema,
PHP, Python, C and C++, and lots of other languages.
With XPath knowledge you will be able to take great advantage of your XSLT
knowledge.
XPath Terminology
Nodes
In XPath, there are seven kinds of nodes: element, attribute, text, namespace,
processing-instruction, comment, and document nodes.
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
XML documents are treated as trees of nodes. The topmost element of the tree
is called the root element.
<bookstore>
<book>
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
</bookstore>
Atomic values
Atomic values are nodes with no children or parent.
J K. Rowling
"en"
Items
Items are atomic values or nodes.
Relationship of Nodes
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
Parent
Each element and attribute has one parent.
In the following example; the book element is the parent of the title, author,
year, and price:
<book>
<title>Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
Children
Element nodes may have zero, one or more children.
In the following example; the title, author, year, and price elements are all
children of the book element:
<book>
<title>Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
Siblings
Nodes that have the same parent.
In the following example; the title, author, year, and price elements are all
siblings:
<book>
<title>Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
Ancestors
A node's parent, parent's parent, etc.
In the following example; the ancestors of the title element are the book
element and the bookstore element:
<bookstore>
<book>
<title>Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
</bookstore>
Descendants
A node's children, children's children, etc.
In the following example; descendants of the bookstore element are the book,
title, author, year, and price elements:
<bookstore>
<book>
<title>Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
</bookstore>
<bookstore>
<book>
<title lang="en">Harry Potter</title>
<price>29.99</price>
</book>
<book>
<title lang="en">Learning XML</title>
<price>39.95</price>
</book>
</bookstore>
Selecting Nodes
XPath uses path expressions to select nodes in an XML document. The node is
selected by following a path or steps. The most useful path expressions are
listed below:
Expression Description
@ Selects attributes
In the table below we have listed some path expressions and the result of the
expressions:
//book Selects all book elements no matter where they are in the
document
bookstore//book Selects all book elements that are descendant of the bookstore
element, no matter where they are under the bookstore
element
Predicates
Predicates are used to find a specific node or a node that contains a specific
value.
In the table below we have listed some path expressions with predicates and
the result of the expressions:
In JavaScript:
xml.setProperty("SelectionLanguage","XPath");
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
Wildcard Description
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
In the table below we have listed some path expressions and the result of the
expressions:
/bookstore/* Selects all the child element nodes of the bookstore element
//title[@*] Selects all title elements which have at least one attribute of
any kind
In the table below we have listed some path expressions and the result of the
expressions:
//book/title | //book/price Selects all the title AND price elements of all book
elements
//title | //price Selects all the title AND price elements in the
document
/bookstore/book/title | //price Selects all the title elements of the book element of
the bookstore element AND all the price elements
in the document
<bookstore>
<book>
<title lang="en">Harry Potter</title>
<price>29.99</price>
</book>
<book>
<title lang="en">Learning XML</title>
<price>39.95</price>
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
</book>
</bookstore>
XPath Axes
An axis defines a node-set relative to the current node.
AxisName Result
preceding Selects all nodes that appear before the current node in
the document, except ancestors, attribute nodes and
namespace nodes
An absolute location path starts with a slash ( / ) and a relative location path
does not. In both cases the location path consists of one or more steps, each
separated by a slash:
/step/step/...
step/step/...
an axis (defines the tree-relationship between the selected nodes and the
current node)
a node-test (identifies a node within an axis)
zero or more predicates (to further refine the selected node-set)
axisname::nodetest[predicate]
Examples
Example Result
child::book Selects all book nodes that are children of the current node
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
ancestor-or- Selects all book ancestors of the current node - and the
self::book current as well if it is a book node
XPath Operators
Below is a list of the operators that can be used in XPath expressions:
+ Addition 6+4
- Subtraction 6-4
* Multiplication 6*4
= Equal price=9.80
or or price=9.80 or price=9.70
Let's try to learn some basic XPath syntax by looking at some examples.
<bookstore>
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
<book category="cooking">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="children">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="web">
<title lang="en">XQuery Kick Start</title>
<author>James McGovern</author>
<author>Per Bothner</author>
<author>Kurt Cagle</author>
<author>James Linn</author>
<author>Vaidyanathan Nagarajan</author>
<year>2003</year>
<price>49.99</price>
</book>
<book category="web">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
Code for older browsers (IE5 and IE6) can be found in the AJAX tutorial.
Selecting Nodes
Unfortunately, there are different ways of dealing with XPath in different
browsers.
Chrome, Firefox, Edge, Opera, and Safari use the evaluate() method to select
nodes:
xmlDoc.selectNodes(xpath);
In our examples we have included code that should work with most major
browsers.
Example
/bookstore/book/title
Example
/bookstore/book[1]/title
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
Example
/bookstore/book/price[text()]
Example
/bookstore/book[price>35]/price
Example
/bookstore/book[price>35]/title
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
This tutorial will teach you how to use XSLT to transform XML documents
into other formats (like transforming XML into HTML).
XSLT Example
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
HTML
XML
If you want to study these subjects first, find the tutorials on our Home page.
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
XSLT References
XSLT Elements
Description of all the XSLT elements from the W3C Recommendation, and
information about browser support.
XSLT 2.0, XPath 2.0, and XQuery 1.0, share the same functions library. There
are over 100 built-in functions. There are functions for string values, numeric
values, date and time comparison, node and QName manipulation, sequence
manipulation, and more.
The World Wide Web Consortium (W3C) started to develop XSL because there
was a need for an XML-based Stylesheet Language.
With the CSS3 Paged Media Module, W3C has delivered a new standard for
document formatting. So, since 2013, CSS3 is proposed as an XSL-FO
replacement.
What is XSLT?
XSLT stands for XSL Transformations
XSLT is the most important part of XSL
XSLT transforms an XML document into another XML document
XSLT uses XPath to navigate in XML documents
XSLT is a W3C Recommendation
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
With XSLT you can add/remove elements and attributes to or from the output
file. You can also rearrange and sort elements, perform tests and make
decisions about which elements to hide and display, and a lot more.
If you want to study XPath first, please read our XPath Tutorial.
XSLT - Transformation
Example study: How to transform XML into XHTML using XSLT?
The correct way to declare an XSL style sheet according to the W3C XSLT
Recommendation is:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
or:
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
To get access to the XSLT elements, attributes and features we must declare
the XSLT namespace at the top of the document.
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
Viewing XML Files in IE, Chrome, Firefox, Safari, and Opera: Open the
XML file (click on the link below) - The XML document will be displayed with
color-coded root and child elements (except in Safari). Often, there is a plus (+)
or minus sign (-) to the left of the elements that can be clicked to expand or
collapse the element structure. Tip: To view the raw XML source, right-click
in XML file and select "View Source"!
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
.
.
</catalog>
If you have an XSLT compliant browser it will nicely transform your XML into
XHTML.
The details of the example above will be explained in the next chapters.
The match attribute is used to associate a template with an XML element. The
match attribute can also be used to define a template for the entire XML
document. The value of the match attribute is an XPath expression (i.e.
match="/" defines the whole document).
Ok, let's look at a simplified version of the XSL file from the previous chapter:
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
Example
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
</tr>
<tr>
<td>.</td>
<td>.</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Try it Yourself »
Example Explained
Since an XSL style sheet is an XML document, it always begins with the XML
declaration: <?xml version="1.0" encoding="UTF-8"?>.
The content inside the <xsl:template> element defines some HTML to write to
the output.
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
The last two lines define the end of the template and the end of the style sheet.
The result from this example was a little disappointing, because no data was
copied from the XML document to the output. In the next chapter you will learn
how to use the <xsl:value-of> element to select values from the XML
elements.
Example
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
</tr>
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
<tr>
<td><xsl:value-of select="catalog/cd/title"/></td>
<td><xsl:value-of select="catalog/cd/artist"/></td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Example Explained
Note: The select attribute, in the example above, contains an XPath
expression. An XPath expression works like navigating a file system; a forward
slash (/) selects subdirectories.
The result from the example above was a little disappointing; only one line of
data was copied from the XML document to the output. In the next chapter you
will learn how to use the <xsl:for-each> element to loop through the XML
elements, and display all of the records.
Example
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Try it Yourself »
= (equal)
!= (not equal)
< less than
> greater than
Example
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
</tr>
<xsl:for-each select="catalog/cd[artist='Bob Dylan']">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Example
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
</tr>
<xsl:for-each select="catalog/cd">
<xsl:sort select="artist"/>
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Note: The select attribute indicates what XML element to sort on.
To put a conditional if test against the content of the XML file, add an <xsl:if>
element to the XSL document.
Syntax
<xsl:if test="expression">
...some output if the expression is true...
</xsl:if>
Example
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
<th>Price</th>
</tr>
<xsl:for-each select="catalog/cd">
<xsl:if test="price > 10">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
<td><xsl:value-of select="price"/></td>
</tr>
</xsl:if>
</xsl:for-each>
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Note: The value of the required test attribute contains the expression to be
evaluated.
The code above will only output the title and artist elements of the CDs that has
a price that is higher than 10.
To insert a multiple conditional test against the XML file, add the <xsl:choose>,
<xsl:when>, and <xsl:otherwise> elements to the XSL file:
Example
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:value-of select="title"/></td>
<xsl:choose>
<xsl:when test="price > 10">
<td bgcolor="#ff00ff">
<xsl:value-of select="artist"/></td>
</xsl:when>
<xsl:otherwise>
<td><xsl:value-of select="artist"/></td>
</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
The code above will add a pink background-color to the "Artist" column WHEN
the price of the CD is higher than 10.
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
Another Example
Here is another example that contains two <xsl:when> elements:
Example
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:value-of select="title"/></td>
<xsl:choose>
<xsl:when test="price > 10">
<td bgcolor="#ff00ff">
<xsl:value-of select="artist"/></td>
</xsl:when>
<xsl:when test="price > 9">
<td bgcolor="#cccccc">
<xsl:value-of select="artist"/></td>
</xsl:when>
<xsl:otherwise>
<td><xsl:value-of select="artist"/></td>
</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
</xsl:stylesheet>
The code above will add a pink background color to the "Artist" column WHEN
the price of the CD is higher than 10, and a grey background-color WHEN the
price of the CD is higher than 9 and lower or equal to 10.
Example
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
<xsl:template match="cd">
<p>
<xsl:apply-templates select="title"/>
<xsl:apply-templates select="artist"/>
</p>
</xsl:template>
<xsl:template match="title">
Title: <span style="color:#ff0000">
<xsl:value-of select="."/></span>
<br />
</xsl:template>
<xsl:template match="artist">
Artist: <span style="color:#00ff00">
<xsl:value-of select="."/></span>
<br />
</xsl:template>
</xsl:stylesheet>
A JavaScript Solution
In the previous chapters we have explained how XSLT can be used to transform
a document from XML to XHTML. We did this by adding an XSL style sheet to
the XML file and let the browser do the transformation.
Even if this works fine, it is not always desirable to include a style sheet
reference in an XML file (e.g. it will not work in a non XSLT aware browser.)
do browser-specific testing
use different style sheets according to browser and user needs
That is the beauty of XSLT! One of the design goals for XSLT was to make it
possible to transform data from one format to another, supporting different
browsers and different user needs.
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
<th style="text-align:left">Title</th>
<th style="text-align:left">Artist</th>
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:value-of select="title" /></td>
<td><xsl:value-of select="artist" /></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
Notice that the XML file does not have a reference to the XSL file.
Example
<!DOCTYPE html>
<html>
<head>
<script>
function loadXMLDoc(filename)
{
if (window.ActiveXObject)
{
xhttp = new ActiveXObject("Msxml2.XMLHTTP");
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
}
else
{
xhttp = new XMLHttpRequest();
}
xhttp.open("GET", filename, false);
try {xhttp.responseType = "msxml-document"} catch(err) {} // Helping IE11
xhttp.send("");
return xhttp.responseXML;
}
function displayResult()
{
xml = loadXMLDoc("cdcatalog.xml");
xsl = loadXMLDoc("cdcatalog.xsl");
// code for IE
if (window.ActiveXObject || xhttp.responseType == "msxml-document")
{
ex = xml.transformNode(xsl);
document.getElementById("example").innerHTML = ex;
}
// code for Chrome, Firefox, Opera, etc.
else if (document.implementation && document.implementation.createDocument)
{
xsltProcessor = new XSLTProcessor();
xsltProcessor.importStylesheet(xsl);
resultDocument = xsltProcessor.transformToFragment(xml, document);
document.getElementById("example").appendChild(resultDocument);
}
}
</script>
</head>
<body onload="displayResult()">
<div id="example" />
</body>
</html>
Tip: If you don't know how to write JavaScript, please study our JavaScript
tutorial.
Example Explained:
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
To make XML data available to all kind of browsers, we can transform the
XML document on the SERVER and send it back to the browser as XHTML.
parser for the transformation. However, this will not work in a browser that
doesn't have an XML parser.
To make XML data available to all kind of browsers, we can transform the XML
document on the server and send back to the browser as XHTML.
That's another beauty of XSLT. One of the design goals for XSLT was to make it
possible to transform data from one format to another on a server, returning
readable data to all kinds of browsers.
<xsl:template match="/">
<h2>My CD Collection</h2>
<table border="1">
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
<tr bgcolor="#9acd32">
<th style="text-align:left">Title</th>
<th style="text-align:left">Artist</th>
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:value-of select="title" /></td>
<td><xsl:value-of select="artist" /></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
Notice that the XML file does not have a reference to the XSL file.
Training
Group Wellesley’s training programs include a range of technical communication tools, technologies,
and core skills. We work with our clients to personalize the training to your specific business needs.
We can offer training sessions at your site or at off-site training facilities.
Our instructor credentials include:
Authorized instructor for Certified Professional Technical Communicator (CPTC) Exam Preparation
Course.
Adobe-Certified Instructor (ACI) in Adobe Captivate and FrameMaker
Certified Technical Trainer (CTT+)
Certified Online Training Professional (COTP)
Contact Group Wellesley at [email protected]. to learn more about our training courses or to
discuss training programs developed specifically for your company.
Training Programs
Adobe Captivate Courses
XPATHM
XPATH MANUAL
CHAPTER 1
BY WWW.W3SCHOOLS.COM
Description: This two-day class teaches the basic concepts of XML. This course is appropriate for
technical writers, publication department managers, and information technology personnel who are
considering migrating to XML-based publishing. Students will learn how XML can improve and
transform conventional publishing processes.
Topics Covered: Designing XML documents; modeling real-world documents to prepare for
migration to XML; learning XML terminology and syntax; expressing your document model as an
XML document type definition (DTD); validating XML documents against a DTD; evaluating industry-
standard DTDs, such as DocBook; authoring XML documents in a text editor and using authoring
tools (Adobe FrameMaker); transforming and customizing XML documents; learning the basics of
XSLT (XML Transformation Language) and XPath (XML Path Language); using XSLT and XPath to
create customized documents by selecting appropriate content for publishing; publishing XML
documents; transforming XML documents to HTML/XHTML for web publishing; transforming XML
documents to WML (wireless markup language) for publishing to cell phones and personal digital
assistants.
Practical Transformation with XSLT and XPath (3 days)
Prerequisites: Introduction to XML , or familiarity with XML syntax and concepts; ability to use a text
editor. knowledge of HTML is highly desirable; and some programming experience with any
language (compiled or interpreted) is highly desirable.
Description: This three-day course completely covers the Extensible Stylesheet Language
Transformations (XSLT) and the XML Path Language (XPath) Recommendations of the World Wide
Web Consortium. XSLT and XPath are used together for transforming XML documents to other
formats or vocabularies (e.g. XML to XML, XML to HTML, XML to WML, XML to text, etc.). Every
element, attribute, and function of XSLT and XPath are covered. Students will design and develop
XSLT scripts during hands-on exercise sessions.
Topics Covered: Introduction to XSL transformations and the XML path language; getting started
with XSLT and XPath; XPath data model; XSLT processing model; XSLT transformation
environment; XSLT stylesheet management; XSLT instructions; XPath and XSLT expressions and
advanced techniques; sorting and grouping; XML to HTML transformation techniques; XSL
formatting semantics introduction; element, grammar, function, and object quick references; and
sample tool information.
Practical Formatting with XSL-FO (2 days)
Prerequisites: Introduction to XML and Practical Transformation with XSLT and XPath , or
equivalent hands-on experience with XML, XSLT, and XPath.
Description: This two-day course provides an overview of the Extensible Stylesheet Language
Formatting Objects (XSL-FO) Recommendation of the World Wide Web Consortium, used to specify
the format of XML documents on a printed page or other page-oriented display. Students will design
and develop XSL-FO scripts using XSLT and XPath during hands-on exercise sessions.
Topics Covered: Basic concepts and context of XSL-FO ; area and page basics; body contents;
lists, graphics, links, leaders; tables; pagination; headers and footers; floats and footnotes; keeps
and breaks; interactive objects; supplemental objects; XSL-FO object summary; XSL-FO property
summary; and sample tool information.