From the W3C Recommendation:
4.7. White space handling in attribute values
When user agents process attributes, they do so in accordance with section 3.3.3 of [XML]:
Separate the top and trailing spaces. Match sequences of one or more space characters (including line breaks) into a single interlayer space. Spaces between tags see Section 3.2. Criteria 9:
3.2. User Agent Alignment
[1-8 snipped]
- White space is processed in accordance with the following rules. The following characters are defined in space characters [XML]:
SPACE () HORIZONTAL TABULATION () CARRIAGE RETURN () LINE FEED () The XML processor normalizes the end-line codes of various systems into a single LINE FEED character, which is transmitted before the application.
The user agent must use the CSS definition to handle whitespace [CSS2]. Note that CSS2's recommendation does not explicitly address the issue of handling spaces in non-Latin character sets. This will be discussed in a future version of CSS, after which this link will be updated.
See also section C.15:
P .15. White space characters in HTML and XML
Some characters that are legal in HTML documents are illegal in an XML document. For example, in HTML a Formfeed character (U + 000C) is treated as a space, in XHTML, because of the XML characters of the characters, it is illegal.
Matas vaitkevicius
source share