xml:space (HTML attribute)
| Depr. | Version |
|---|---|
| No | XHTML 1.0 |
Example
The script white
spaces set to "preserve" in XHTML 1.0:
<script type="text/javascript" src="/scripts/complex.js" xml:space="preserve"></script>
Description
If the
xml:space attribute is applied with the value
"preserve" to the script element,
the user agent (aka the browser) must leave all whitespace characters
intact (with the exception of leading and trailing whitespace characters,
which should be removed). Otherwise, whitespace will be collapsed
according to the rules defined in XHTML modularization (a much simplified
summary: duplicate or unnecessary white spaces are
removed).
Value
"preserve" only (to
not preserve whitespace, simply omit attribute)
Compatibility
User-contributed notes
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.
