Re: Whitespace in markup languages

Yes. And XSLT 2.0 processors (may) use the schema normalised value of an element with simple content, so it’s not only whitespace that appears in element-only content that can be removed.

Nevertheless, the construction of the XPath data model does follow the rules that I outlined: in particular, whitespace is never removed from elements that have mixed content. It does, however, mean that if you are using schema validation, you need to be pretty careful about how you define your types (but you should be anyway, to provide users with the right information about what whitespace normalisation is expected).

Reply

The content of this field is kept private and will not be shown publicly.