Space preservation

The XML standard defines the term 'whitespace' to represent the invisible characters used to format text in a text file. These characters include the space character, the tab character, and the line-feed and carriage-return control characters (used to start a new line in the text file).

Sometimes, whitespace characters are included in an XML document only to make the markup easier to read. The following two examples are considered to be equivalent in terms of the information they contain, but the second is more legible:

<chapter><title>The Chapter Title</title><para>A para-
graph.</para></chapter>
<chapter>
  <title>The Chapter Title</title>
  <para>A paragraph.</para>
</chapter>

In both examples, the Chapter element appears ...

Get XSL companion, The 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.