Schemas

The W3C XML Schema Language uses the whiteSpace facet to specify whether white space in an attribute or element with a simple type should be preserved, replaced, or collapsed.

  • Preserved white space is like xml:space="preserve"; that is, all white space is considered to be significant.

  • Replaced white space replaces all tabs, carriage returns, and line feeds with a single space each. Thus the number of white space characters is preserved but their type may be changed.

  • Collapsed white space first replaces all carriage returns and line feeds with a single space each, then replaces each run of consecutive spaces with a single space, and finally trims all leading and trailing white space.

However, once again this only offers a hint to the client ...

Get Effective XML: 50 Specific Ways to Improve Your XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.