Name
<xsl:strip-space>
Defines the source-document elements for which nonsignificant whitespace should be removed.
Category
Top-level element.
Required Attribute
elementsContains a space-separated list of element names or node tests for which nonsignificant whitespace should be removed. Nonsignificant whitespace typically means text nodes that contain nothing but whitespace; whitespace that appears in and around text is always preserved. The
elementsattribute can also contain the value*, which means whitespace should be removed from all elements not specified in an<xsl:preserve-space>element. The valueelements="auth:*"is also legal; this specifies all elements in theauthnamespace.[2.0] In XSLT 2.0, the
elementsattribute can also use wildcards for the namespace prefix. For example, the value*:titlerefers to all<title>elements, regardless of their namespaces.Note
The XML spec defines the seldom used attribute
xml:space. Thexml:spaceattribute can have the valuespreserveordefault. Ifxml:space="preserve"applies to a given element in the XML source, all whitespace is preserved, regardless of any<xsl:preserve-space>or<xsl:strip-space>elements.
Optional Attributes
None.
Content
None. <xsl:strip-space>
is an empty element.
Appears in
<xsl:strip-space> is a
top-level element and can only appear as a child of <xsl:stylesheet>.
Defined in
[1.0] XSLT section 3.4, “Whitespace Stripping.”
[2.0] XSLT section 4.4, “Stripping Whitespace from a Source Tree.”
Example
We’ll illustrate the <xsl:strip-space> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access