A Complete XML Example

<html xmlns="http://www.w3.org/1999/xhtml"
<title>XPath Location Template</title>

<p>Calculate an XPath child-sequence to
an element node.</p>


<src:fragment id="top" mundane-result-prefixes="xsl">
<xsl:template name="xpath.location">
  <src:fragref linkend="xpath.location.node"/>
  <src:fragref linkend="xpath.location.path"/>

  <xsl:variable name="next.path">
    <xsl:value-of select="local-name($node)"/>

<h3>Public Parameters</h3>
<src:fragment id='xpath.location.node'>
<xsl:param name="node" select="."/>
<p>The target node. If unspecified, the context
node is used.</p></dd>

<h3>Private Parameters</h3>
<src:fragment id="xpath.location.path">
<xsl:param name="path" select="''"/>
<p>The partially constructed path. Initially the empty string,
this parameter holds the path built during recursive invocation
of the template.</p></dd>

<p>The xpath.location template calculates
the absolute path from the root of
the tree to an element node, by default,
the context node.</p>
  • Documentation is pervasively attached to the source.

  • The code is immersed in the documentation.

  • The documentation is immersed in the code.

  • The order of the code fragments in the documentation is entirely independent of the order of the code fragments in the program.