Use Separate Elements

<doc:template xmlns:doc="http://..." xmlns="http://..."
<p>Calculate an XPath child-sequence to
an element node.</p>
<h2>Public Parameters</h2>
<dd><p>The target node. If unspecified, the context
node is used.</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>
<xsl:template name="xpath.location">
  <xsl:param name="node" select="."/>
  <xsl:param name="path" select="''"/>

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

  • Documentation is nearby.

  • Documentation is in XML.

  • Documentation is tenuously attached to the source.