Partager via


Release Notes: Handling White Space with the MSXML Processor

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

In most cases, the behavior of the Microsoft XML Parser (MSXML) processor conforms to white space handling rules imposed by the XML and XSL Transformations (XSLT) specifications.

The following are the exceptions:

  • Adjacent text nodes are not treated as one node. Adjacent text nodes can appear if:
    • The user inserts them into the tree through the Document Object Model (DOM) application programming interface (API).
    • CDATA sections border #PCDATA nodes.
    • An entity reference containing text borders a #PCDATA or CDATA node. (Character references, such as 
 to represent a newline, are automatically expanded by the parser and handled correctly.)
      Few style sheets will encounter any of these conditions. Furthermore, even if adjacent text nodes exist, users seldom query for text nodes directly. (In most cases, users obtain text nodes by referring to element and attribute nodes.)
  • When the preserveWhitespace property is FALSE, the white space stripped by the DOM is reduced to flags that mark where white space existed. These flags are used to output extra white space when <xsl:copy-of> is used or when the text value of a node is retrieved. These flags act as "virtual" nodes that cannot be queried, but nevertheless behave like text nodes with a value of &#x10; (newline) on output. This does not occur if preserveWhitespace is TRUE because flags are not used.
  • CDATA nodes containing only white space are never stripped.

Behavior that does not conform to XML and XSL specifications will be corrected in a future release of the MSXML processor.

See Also

Concepts

Controlling White Space with XSLT