W3C home > Mailing lists > Public > www-html-editor@w3.org > April to June 2005

Other Problems with HTML and XHTML Frequently Answered Questions

From: Collin Hsu <collin@w3china.org>
Date: Sun, 22 May 2005 22:57:26 +0800
To: <www-html-editor@w3.org>
Message-ID: <E1DZrtY-00061v-I8@lisa.w3.org>

1) 

{{

Why is xml:space set to 'preserve' on all elements of XHTML? I don't want to
see extra space in my output.

The attribute xml:space is about input: that is to say, it controls if the
spaces will be present in the DOM (i.e. in the internal version of the
document inside the browser); it says nothing about what will appear on your
screen. Output whitespace is controlled by the CSS property 'whitespace'.
Set it to 'pre' and the spaces in the DOM will be preserved on output; set
it to 'normal' and the whitespace will be collapsed (CSS3 will have more
properties to enable greater control).

This is the reason that all elements are set to xml:space="preserve" in
XHTML2, otherwise the CSS 'whitespace' property would have no effect, and
you would have no control over visible whitespace. The default stylesheet
will set 'whitespace' to 'normal' for all elements except <pre>, but you
will be free to change them.

}}

I think it would be more accurate if the "XHTML" in the title is replaced
with "XHTML 2".

2)

I notice in the FAQ sometimes it is written as "XHTML2" and sometimes "XHTML
2".  Is it possible that they are unified to be "XHTML 2"(probably more
formal than "XHTML2")?

Collin
Received on Sunday, 22 May 2005 14:57:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:17:54 GMT