Suggestions |
---|
Search:
|
Next:
scape.slash.hyphen |
Previous:
text() (in slash.hyphen mode) Up: Whitespace Normalization and Character Encoding normalize scape.mod.xsl |
trim-outer — Whitespace Normalization and Discretionary Elision
<xsl:template name="trim-outer"> <xsl:param name="string"/> <xsl:variable name="trimleft" select="position()=1"/> <xsl:variable name="trimright" select="position()=last()"/> ... </xsl:template>
This template is used by various text() templates to normalise interior whitespace and trim whitespace that occurs at the start or end of a DocBook element's content.
The template is normally called when the context node is within a DocBook document. The elision of leading or trailing whitespace is dependent on values of the XPath functions position() and last(). This is similar to the handling of whitespace by SGML parsers and allows authors to format their XML documents with “pretty” indentation without causing spurious whitespace in LaTeX.
In all cases, interiour whitespace will be normalised with the XPath normalize-space() function. This is necessary to prevent blank-line problems in LaTeX.