Share via


xsl:preserve-space Element (Compact 2013)

3/26/2014

Preserves white space in a document.

Syntax

<xsl:preserve-space
  elements = tokens />

Attributes

  • elements
    [required] White space-separated list of name tests.

Element Information

Number of occurrences

Unlimited

Parent elements

xsl:stylesheet, xsl:transform

Child elements

(No child elements)

Remarks

<xsl:preserve-space> is a white space-preserving element and has an elements attribute whose value is a white space-separated list of name tests. Initially, the set of white space-preserving element names contains all element names. If an element name matches a name test in an <xsl:strip-space> element, then it is removed from the set of white space-preserving element names. If an element name matches a name test in an <xsl:preserve-space> element, then it is added to the set of white space-preserving element names. An element matches a name test if and only if the name test would be true for the element as an XML Path Language (XPath) node test. The applicable match for a particular element name is determined as follows.

  • First, any match with lower import precedence than another match is ignored.
  • Next, any match with a name test that has a lower default priority than the default priority of the name test of another match is ignored.
  • It is an error if this leaves more than one match.

See Also

Reference

XSLT Elements
xsl:strip-space Element