<s1 title="Introduction">

<p>XPath is a language for selecting XML nodes.  It was originally part of the
XSLT spec, but was split out because the W3C realized XPath was useful
by itself. XPath is used to</p>

<ul>
<li>Find XML nodes
<li>Iterate over matching XML nodes
<li>Spider web pages
<li>Extract values from XML
<li>Drive the XSLT match patterns
</ul>

<p>Although the main use of XPath is in conjunction with XSLT, Resin
provides an API in com.caucho.xpath to extract values from XML.</p>

<p>The core of the XPath language is hierarchical path, like a URL.</p>

<deftable>
<tr><td>a<td>matches any element <var/a/>
<tr><td>*<td>matches any element, but not attributes or text nodes 
<tr><td>@b<td>matches any attribute <var/b/>
<tr><td>text()<td>matches any text node
<tr><td>a/b<td>matches an element <var/b/> only if it's a child of an <var/a/>
<tr><td>/html/body<td>matches <var/body/> only if it's the child of <var/html/>
and <var/html/> is the top element.
<tr><td>a[b]<td>matches an element <var/a/> only if it has a child element <var/b/>
</deftable>
</s1>
