<refsect1><title>Description</title>
-<programlisting><src:fragment xml:id='dot.count.frag'>
+ <para>Given a string, the <function>dot.count</function>
+ template returns the number of dot/period characters in the
+ string. This template is useful, for example, when testing the
+ nesting level of nested inline markup (for nested emphasis,
+ quotations, etc.).</para>
+
+<src:fragment xml:id='dot.count.frag'>
<xsl:template name="dot.count">
<!-- Returns the number of "." characters in a string -->
<xsl:param name="string"></xsl:param>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-</src:fragment></programlisting>
+</src:fragment>
</refsect1>
</refentry>
<refsect1><title>Description</title>
-<programlisting><src:fragment xml:id='copy-string.frag'>
+ <para>Given a string, the <function>copy-string</function>
+ template creates <replaceable>n</replaceable> copies of the
+ string, when the value of <replaceable>n</replaceable> is
+ given by the <parameter>count</parameter> parameter.</para>
+
+<src:fragment xml:id='copy-string.frag'>
<xsl:template name="copy-string">
<!-- returns 'count' copies of 'string' -->
<xsl:param name="string"></xsl:param>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-</src:fragment></programlisting>
+</src:fragment>
</refsect1>
</refentry>
with <parameter>replacement</parameter> and returns the result.
</para>
-<programlisting><src:fragment xml:id='string.subst.frag'>
+<src:fragment xml:id='string.subst.frag'>
<xsl:template name="string.subst">
<xsl:param name="string"></xsl:param>
<xsl:param name="target"></xsl:param>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-</src:fragment></programlisting>
+</src:fragment>
</refsect1>
</refentry>
or <literal>#xpointer(id('foo'))</literal>, otherwise it returns
the empty string.</para>
-<programlisting><src:fragment xml:id='xpointer.idref.frag'>
+<src:fragment xml:id='xpointer.idref.frag'>
<xsl:template name="xpointer.idref">
<xsl:param name="xpointer">http://...</xsl:param>
<xsl:choose>
<!-- otherwise it's a pointer to some other document -->
</xsl:choose>
</xsl:template>
-</src:fragment></programlisting>
+</src:fragment>
</refsect1>
</refentry>
unqualified length ("20" for "20pt") from a dimension.
</para>
-<programlisting><src:fragment xml:id='length-magnitude.frag'>
+<src:fragment xml:id='length-magnitude.frag'>
<xsl:template name="length-magnitude">
<xsl:param name="length" select="'0pt'"/>
</xsl:when>
</xsl:choose>
</xsl:template>
-</src:fragment></programlisting>
+</src:fragment>
</refsect1>
</refentry>
units ("pt" for "20pt") from a length. If no units are supplied on the
length, the <parameter>defauilt.units</parameter> are returned.</para>
-<programlisting><src:fragment xml:id='length-units.frag'>
+<src:fragment xml:id='length-units.frag'>
<xsl:template name="length-units">
<xsl:param name="length" select="'0pt'"/>
<xsl:param name="default.units" select="'px'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-</src:fragment></programlisting>
+</src:fragment>
</refsect1>
</refentry>
the <parameter>default.units</parameter> will be added to it.
</para>
-<programlisting><src:fragment xml:id='length-spec.frag'>
+<src:fragment xml:id='length-spec.frag'>
<xsl:template name="length-spec">
<xsl:param name="length" select="'0pt'"/>
<xsl:param name="default.units" select="'px'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-</src:fragment></programlisting>
+</src:fragment>
</refsect1>
</refentry>
</para>
</caution>
-<programlisting><src:fragment xml:id='length-in-points.frag'>
+<src:fragment xml:id='length-in-points.frag'>
<xsl:template name="length-in-points">
<xsl:param name="length" select="'0pt'"/>
<xsl:param name="em.size" select="10"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-</src:fragment></programlisting>
+</src:fragment>
</refsect1>
</refentry>
contain badly formed pseudo-attributes (missing or unbalanced quotes,
for example), the template may silently return erroneous results.</para>
-<programlisting><src:fragment xml:id='pi-attribute.frag'>
+<src:fragment xml:id='pi-attribute.frag'>
<xsl:template name="pi-attribute">
<xsl:param name="pis" select="processing-instruction('BOGUS_PI')"/>
<xsl:param name="attribute">filename</xsl:param>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-</src:fragment></programlisting>
+</src:fragment>
</refsect1>
</refentry>
the <function>lookup.key</function> template extracts the value associated
with a particular key.</para>
-<programlisting><src:fragment xml:id='lookup.key.frag'>
+<src:fragment xml:id='lookup.key.frag'>
<xsl:template name="lookup.key">
<xsl:param name="key" select="''"/>
<xsl:param name="table" select="''"/>
</xsl:choose>
</xsl:if>
</xsl:template>
-</src:fragment></programlisting>
+</src:fragment>
</refsect1>
</refentry>
absolute path from the root of the tree to the current element node.
</para>
-<programlisting><src:fragment xml:id='xpath.location.frag'>
+<src:fragment xml:id='xpath.location.frag'>
<xsl:template name="xpath.location">
<xsl:param name="node" select="."/>
<xsl:param name="path" select="''"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-</src:fragment></programlisting>
+</src:fragment>
</refsect1>
</refentry>
Internal occurrences of "--" will be replaced with "- -" and a leading and/or
trailing space will be added to the string, if necessary.</para>
-<programlisting><src:fragment xml:id='comment-escape-string.frag'>
+<src:fragment xml:id='comment-escape-string.frag'>
<xsl:template name="comment-escape-string">
<xsl:param name="string" select="''"/>
<xsl:text> </xsl:text>
</xsl:if>
</xsl:template>
-</src:fragment></programlisting>
+</src:fragment>
</refsect1>
</refentry>
<para>The <function>comment-escape-string.recursive</function> template is used
by <function>comment-escape-string</function>.</para>
-<programlisting><src:fragment xml:id="comment-escape-string.recursive.frag">
+<src:fragment xml:id="comment-escape-string.recursive.frag">
<xsl:template name="comment-escape-string.recursive">
<xsl:param name="string" select="''"/>
<xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-</src:fragment></programlisting>
+</src:fragment>
</refsect1>
</refentry>
<para>Given a text node, this function trims leading and trailing
whitespace from it and returns the trimmed contents.</para>
-<programlisting><src:fragment xml:id='trim.text.frag'>
+<src:fragment xml:id='trim.text.frag'>
<xsl:template name="trim.text">
<xsl:param name="contents" select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-</src:fragment></programlisting>
+</src:fragment>
</refsect1>
</refentry>
differs only in that it preserves the delimiters instead of
discarding them.</para>
</note>
-<programlisting><src:fragment xml:id='str.tokenize.keep.delimiters.frag'>
+<src:fragment xml:id='str.tokenize.keep.delimiters.frag'>
<xsl:template name="str.tokenize.keep.delimiters">
<xsl:param name="string" select="''" />
<xsl:param name="delimiters" select="' '" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-</src:fragment></programlisting>
+</src:fragment>
</refsect1>
</refentry>
class="attribute">string</tag> attributes.</para>
</note>
- <programlisting><src:fragment xml:id='apply-string-subst-map.frag'>
+ <src:fragment xml:id='apply-string-subst-map.frag'>
<xsl:template name="apply-string-subst-map">
<xsl:param name="content"/>
<xsl:param name="map.contents"/>
</xsl:choose>
</xsl:template>
- </src:fragment></programlisting>
+ </src:fragment>
</refsect1>
</refentry>
class="attribute">string</tag> attributes.</para>
</note>
- <programlisting><src:fragment xml:id='apply-character-map.frag'>
+ <src:fragment xml:id='apply-character-map.frag'>
<xsl:template name="apply-character-map">
<xsl:param name="content"/>
<xsl:param name="map.contents"/>
</xsl:choose>
</xsl:template>
- </src:fragment></programlisting>
+ </src:fragment>
</refsect1>
</refentry>
parameter. The current implementation of that capability here relies
on the <function>evaluate</function> extension XSLT function.</para>
-<programlisting><src:fragment xml:id='read-character-map.frag'>
+<src:fragment xml:id='read-character-map.frag'>
<xsl:template name="read-character-map">
<xsl:param name="use.subset"/>
<xsl:param name="subset.profile"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-</src:fragment></programlisting>
+</src:fragment>
</refsect1>
</refentry>
<para>This function counts the number of path components in a relative URI.</para>
-<programlisting><src:fragment xml:id='count.uri.path.depth.frag'>
+<src:fragment xml:id='count.uri.path.depth.frag'>
<xsl:template name="count.uri.path.depth">
<xsl:param name="filename" select="''"/>
<xsl:param name="count" select="0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-</src:fragment></programlisting>
+</src:fragment>
</refsect1>
</refentry>
<para>This function trims common leading path components from a relative URI.</para>
-<programlisting><src:fragment xml:id='trim.common.uri.paths.frag'>
+<src:fragment xml:id='trim.common.uri.paths.frag'>
<xsl:template name="trim.common.uri.paths">
<xsl:param name="uriA" select="''"/>
<xsl:param name="uriB" select="''"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-</src:fragment></programlisting>
+</src:fragment>
</refsect1>
</refentry>