The <xsl:strip-space> declaration, along with <xsl: preserve-space > , is used to control the way in which whitespace nodes in the source document are handled. The <xsl:strip-space> declaration identifies elements in which whitespace-only text nodes are considered insignificant, so they can be removed from the source tree.
The syntax of a NameTest has been extended to allow the format «*:NCName » , which matches all elements with a given local name , in any namespace.
<xsl:strip-space elements = tokens />
<xsl:strip-space> is a top-level declaration, which means it is always a child of the <xsl:stylesheet> element. There are no constraints on where it appears relative to other declarations.
Name | Value | Meaning |
---|---|---|
elements mandatory | Whitespace-separated list of NameTests | Defines elements in the source document whose whitespace-only text nodes are to be removed |
The construct NameTest is defined in XPath; because it is used also in XSLT patterns, it is explained in Chapter 6, on page 509.
None, the element is always empty.
See <xsl:preserve-space> on page 406. The two elements <xsl:strip-space> and <xsl:preserve-space> are closely related , so I have presented the rules and usage guidance in one place.
<xsl:preserve-space> on page 406
<xsl:text> on page 459