xml:space Handling in XAML

The xml:space attribute is an XML-defined attribute that declares the significant white-space processing behavior within an object element. This behavior is relevant for all content (inner text) contained within the element where xml:space is declared, and also scopes to child elements.

XAML Attribute Usage

<object xml:space="preserve" />

- or -

<object xml:space="default" />

Remarks

The definition for the xml:space attribute in XAML including its two possible values is derived from xml:space as defined as a "special attribute" by W3C specifications for XML.

The default value of the xml:space attribute is the literal value "default". For the value "default", or if xml:space is not indicated at all, the behavior of significant white-space parsing is the default handling, as defined in the topic White-space processing in XAML.

To preserve white space within object element content, specify xml:space="preserve" on that object element.

Under most interpretations, the xml:space attribute effects and the value of the attribute are scoped to child elements.

For a complete discussion of white-space processing in XAML, see White-space processing in XAML.

See also