Whitespace

Type: String

Overrides whitespace handling for the element. Allowed values are 'auto', 'normalize' and 'preserve'.

In many use cases of XML, whitespace at the start or end of elements and sequences of multiple consecutive whitespace characters may not be preserved. This includes when the document is converted to and rendered as HTML, or when "pretty print"-type formatting is applied or removed in a source-level XML editor.

By default, Fonto uses the schema to determine whether whitespace inserted into the document should be normalized or preserved. If the schema does not specify otherwise, Fonto defaults to normalizing whitespace. Schema's can specify that whitespace should be preserved by defining a default or fixed value for the xml:space attribute, or by using the whiteSpace facet in an element's simpleType. Please note that, in accordance with the XML Schema specification, the whiteSpace facet defaults to "preserve" for the xs:string simple type.

As not every schema includes this information, this property allows manually specifying the whitespace behavior for specific nodes. A value of 'normalize' forces whitespace normalization, while 'preserve' will keep all whitespace untouched.

This value automatically applies to descendants, unless those specify a different value in their schema or configuration.

Default value is 'auto'. For families that support withNewlineBreakToken, whitespace is automatically set to 'preserve' if withNewlineBreakToken is true.

Was this page helpful?