Re: [whatwg] xml:space

2008-04-28 Thread Křištof Želechovski
This issue is not limited to PRE, nor is PRE the main application.  
There are numerous community Web sites 
that allow the users to submit hypertext content.  
You often get italic bold after you submit 
unless you use a zero-width non-joiner between them.
While this is not strictly a HTML problem, 
allowing xml:space would allow a workaround for broken CMS.

Chris

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ian Hickson
Sent: Monday, April 28, 2008 3:29 AM
To: Henri Sivonen; liorean; Anne van Kesteren; Martin Atkins
Cc: whatwg
Subject: Re: [whatwg] xml:space


I haven't done anything with xml:space. It doesn't do anything, and it's 
not an HTML5 thing, so as far as I can tell it is out of scope for HTML5.


On Mon, 22 Jan 2007, Henri Sivonen wrote:
> > 
> > Since this editor artifact is harmless in browsers and useful in 
> > editors, it would be nice if the spec made it conforming at least on 
> > the  element in XHTML5.
>
> Suggested text:
>
> The xml:space attribute may be used on XHTML elements of XML documents. 
> Authors must not use the xml:space attribute in HTML documents. The 
> xml:space attribute, if present, must have the literal value "default" 
> or the literal value "preserve". The meaning of this attribute is 
> outside the scope of this specification.
> 
> If that's too permissive, here's what would minimally cover my use case: 
> In XHTML (but not in HTML), the element pre may have the attribute 
> xml:space. If the attribute is present, the value of the attribute must 
> be "preserve".
> 
> The first conforms to XML 1.0 for sure. The latter may not exactly, 
> depending on spec interpretation.

I don't see why we should special-case this particular harmless non-HTML 
feature, and not any number of other harmless non-HTML features. If 
another specification wants to define something, then it's up to that 
specification to define when it can be used.



On Tue, 23 Jan 2007, Martin Atkins wrote:
> 
> Presumably its primary purpose is to act as a signal to generic XML 
> tools - that don't have any special knowledge about XHTML - that 
> they should not screw around with the whitespace inside PRE, etc.
> 
> One obvious example of such a tool is an XML pretty-printer. While an 
> HTML pretty-printer like HTML Tidy can have rules "hard-coded" into it, 
> this is not true of a non-validating XML formatter unless it is 
> specifically written for XHTML.

It seems that given the importance of XHTML, we can expect pretty printers 
to be written for it.






Re: [whatwg] xml:space

2008-04-27 Thread Ian Hickson

I haven't done anything with xml:space. It doesn't do anything, and it's 
not an HTML5 thing, so as far as I can tell it is out of scope for HTML5.


On Mon, 22 Jan 2007, Henri Sivonen wrote:
> > 
> > Since this editor artifact is harmless in browsers and useful in 
> > editors, it would be nice if the spec made it conforming at least on 
> > the  element in XHTML5.
>
> Suggested text:
>
> The xml:space attribute may be used on XHTML elements of XML documents. 
> Authors must not use the xml:space attribute in HTML documents. The 
> xml:space attribute, if present, must have the literal value "default" 
> or the literal value "preserve". The meaning of this attribute is 
> outside the scope of this specification.
> 
> If that's too permissive, here's what would minimally cover my use case: 
> In XHTML (but not in HTML), the element pre may have the attribute 
> xml:space. If the attribute is present, the value of the attribute must 
> be "preserve".
> 
> The first conforms to XML 1.0 for sure. The latter may not exactly, 
> depending on spec interpretation.

I don't see why we should special-case this particular harmless non-HTML 
feature, and not any number of other harmless non-HTML features. If 
another specification wants to define something, then it's up to that 
specification to define when it can be used.


On Tue, 23 Jan 2007, Henri Sivonen wrote:
> 
> (As a practical matter, it would be nice to explicitly remind 
> conformance checker developers that the attribute is conforming. 
> Otherwise, it is easily forgotten. :-)

Forgeting it seems fine to me...


On Tue, 23 Jan 2007, liorean wrote:
> 
> Well, considering the purpose of XHTML (main purpose is presentation for 
> humans, no?) is there any reason to NOT just set it to default to 
> "preserve" on the html element, fixed to "preserve" on the script, 
> style, pre and textarea elements and have it implied through an entity 
> for all other elements? Style sheets can change whether presentation of 
> whitespace is collapsed or not. By default, the whitespace is collapsed 
> but for the pre element it's conserved, but that can overridden by user 
> or author style sheets. But whitespace that is structurally collapsed at 
> the XML level cannot be restored for presentation by the style sheet, so 
> this whitespace is lost from ever being presented as it appeared in the 
> document.

xml:space doesn't allow whitepsace to be collapsed at the XML level as far 
as I can tell.


On Tue, 23 Jan 2007, Anne van Kesteren wrote:
> 
> Regarding whether or not HTML5 should mention it. It seems the intention 
> of the XML specification is that you have to say it's allowed: "In valid 
> documents, this attribute, like any other, MUST be declared if it is 
> used." Opinions probably vary on this.

"Valid" in XML is only relevant for DTDs.


On Tue, 23 Jan 2007, liorean wrote:
> 
> Hmm, reading the relevant part of the XML1.0 spec again, I see you're 
> right. So, it would seem to me that it's an attribute describing 
> whitespace semantics in content, not a structural attribute like I 
> thought. So, say you have a  element, but where the element 
> semantics doesn't specify whether whitespace is important in the poem or 
> not (it might be, but that depends on the poem content), you can specify 
> it in that attribute.

Seems like it'd be better for the spec itself to define the semantics of 
its elements rather than depend on the author to specify the attribute...


On Tue, 23 Jan 2007, Martin Atkins wrote:
> 
> Presumably its primary purpose is to act as a signal to generic XML 
> tools — that don't have any special knowledge about XHTML — that 
> they should not screw around with the whitespace inside PRE, etc.
> 
> One obvious example of such a tool is an XML pretty-printer. While an 
> HTML pretty-printer like HTML Tidy can have rules "hard-coded" into it, 
> this is not true of a non-validating XML formatter unless it is 
> specifically written for XHTML.

It seems that given the importance of XHTML, we can expect pretty printers 
to be written for it.


On Tue, 23 Jan 2007, Henri Sivonen wrote:
> 
> (And this isn't theoretical, either. I came across this issue when 
> editing an XHTML document in oXygen.)

File a bug with them. :-)


On Tue, 23 Jan 2007, liorean wrote:
> 
> How doesn't it? If the DTD allows it on all elements, you can put 
> xml:space="preserve" on all elements in the document that need it for 
> the tools that don't use the external subset or namespace recognition

On Wed, 24 Jan 2007, Henri Sivonen wrote:
> 
> There's no DTD.

Indeed.

-- 
Ian Hickson   U+1047E)\._.,--,'``.fL
http://ln.hixie.ch/   U+263A/,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Re: [whatwg] xml:space

2007-01-23 Thread Henri Sivonen

On Jan 23, 2007, at 23:48, liorean wrote:


If the DTD allows it on all elements,


There's no DTD.


you can put
xml:space="preserve" on all elements in the document that need it for
the tools that don't use the external subset or namespace recognition


The start of this thread was about getting the WA 1.0 spec give the  
OK for doing just that.


--
Henri Sivonen
[EMAIL PROTECTED]
http://hsivonen.iki.fi/




Re: [whatwg] xml:space

2007-01-23 Thread liorean

On 1/23/07, Henri Sivonen <[EMAIL PROTECTED]> wrote:

On Jan 23, 2007, at 17:45, liorean wrote:
> Well, considering the purpose of XHTML (main purpose is presentation
> for humans, no?) is there any reason to NOT just set it to default to
> "preserve" on the html element, fixed to "preserve" on the script,
> style, pre and textarea elements and have it implied through an entity
> for all other elements?

Since this is about generic XML tools, XHTML-specific rules don't help.


How doesn't it? If the DTD allows it on all elements, you can put
xml:space="preserve" on all elements in the document that need it for
the tools that don't use the external subset or namespace recognition
--
David "liorean" Andersson


Re: [whatwg] xml:space

2007-01-23 Thread Henri Sivonen

On Jan 23, 2007, at 23:15, Martin Atkins wrote:

Presumably its primary purpose is to act as a signal to generic XML  
tools — that don't have any special knowledge about XHTML — that  
they should not screw around with the whitespace inside PRE, etc.


Exactly.

On Jan 23, 2007, at 17:45, liorean wrote:

Well, considering the purpose of XHTML (main purpose is presentation
for humans, no?) is there any reason to NOT just set it to default to
"preserve" on the html element, fixed to "preserve" on the script,
style, pre and textarea elements and have it implied through an entity
for all other elements?


Since this is about generic XML tools, XHTML-specific rules don't help.

(And this isn't theoretical, either. I came across this issue when  
editing an XHTML document in oXygen.)


--
Henri Sivonen
[EMAIL PROTECTED]
http://hsivonen.iki.fi/




Re: [whatwg] xml:space

2007-01-23 Thread Martin Atkins

Anne van Kesteren wrote:


xml:space can't affect the tree being formed as far as I know. It's not 
entirely clear to me what its use is anyway, except in SVG, where they 
defined it in a funny way to make it do something.




Presumably its primary purpose is to act as a signal to generic XML 
tools — that don't have any special knowledge about XHTML — that they 
should not screw around with the whitespace inside PRE, etc.


One obvious example of such a tool is an XML pretty-printer. While an 
HTML pretty-printer like HTML Tidy can have rules "hard-coded" into it, 
this is not true of a non-validating XML formatter unless it is 
specifically written for XHTML.




Re: [whatwg] xml:space

2007-01-23 Thread liorean

On 1/23/07, Anne van Kesteren <[EMAIL PROTECTED]> wrote:

xml:space can't affect the tree being formed as far as I know. It's not
entirely clear to me what its use is anyway, except in SVG, where they
defined it in a funny way to make it do something.


Hmm, reading the relevant part of the XML1.0 spec again, I see you're
right. So, it would seem to me that it's an attribute describing
whitespace semantics in content, not a structural attribute like I
thought. So, say you have a  element, but where the
element semantics doesn't specify whether whitespace is important in
the poem or not (it might be, but that depends on the poem content),
you can specify it in that attribute.
--
David "liorean" Andersson


Re: [whatwg] xml:space

2007-01-23 Thread Anne van Kesteren

On Tue, 23 Jan 2007 10:45:15 -0500, liorean <[EMAIL PROTECTED]> wrote:

Well, considering the purpose of XHTML (main purpose is presentation
for humans, no?) is there any reason to NOT just set it to default to
"preserve" on the html element, fixed to "preserve" on the script,
style, pre and textarea elements and have it implied through an entity
for all other elements? Style sheets can change whether presentation
of whitespace is collapsed or not. By default, the whitespace is
collapsed but for the pre element it's conserved, but that can
overridden by user or author style sheets. But whitespace that is
structurally collapsed at the XML level cannot be restored for
presentation by the style sheet, so this whitespace is lost from ever
being presented as it appeared in the document.


xml:space can't affect the tree being formed as far as I know. It's not  
entirely clear to me what its use is anyway, except in SVG, where they  
defined it in a funny way to make it do something.



Regarding whether or not HTML5 should mention it. It seems the intention  
of the XML specification is that you have to say it's allowed: "In valid  
documents, this attribute, like any other, MUST be declared if it is  
used." Opinions probably vary on this.



--
Anne van Kesteren




Re: [whatwg] xml:space

2007-01-23 Thread liorean

On 1/23/07, Henri Sivonen <[EMAIL PROTECTED]> wrote:

On Jan 22, 2007, at 23:57, Ian Hickson wrote:
> It's automatically conforming everywhere, no? Isn't it an XML thing?
It is an XML thing. XML 1.0 4th ed. says:
> A special attribute named xml:space may be attached to an element
> to signal an intention that in that element, white space should be
> preserved by applications. In valid documents, this attribute, like
> any other, MUST be declared if it is used. When declared, it MUST
> be given as an enumerated type whose values are one or both of
> "default" and "preserve".
http://www.w3.org/TR/REC-xml/#sec-white-space

So the vocabularies that have a DTD and wish to use the attribute
must declare it in the DTD. For DTDless vocabularies, it doesn't
exactly say whether the vocabularies should explicitly allow the
attribute, but explicitly allowing it leaves no ambiguity.


Well, considering the purpose of XHTML (main purpose is presentation
for humans, no?) is there any reason to NOT just set it to default to
"preserve" on the html element, fixed to "preserve" on the script,
style, pre and textarea elements and have it implied through an entity
for all other elements? Style sheets can change whether presentation
of whitespace is collapsed or not. By default, the whitespace is
collapsed but for the pre element it's conserved, but that can
overridden by user or author style sheets. But whitespace that is
structurally collapsed at the XML level cannot be restored for
presentation by the style sheet, so this whitespace is lost from ever
being presented as it appeared in the document.
--
David "liorean" Andersson


Re: [whatwg] xml:space

2007-01-23 Thread Henri Sivonen

On Jan 22, 2007, at 23:57, Ian Hickson wrote:


It's automatically conforming everywhere, no? Isn't it an XML thing?


It is an XML thing. XML 1.0 4th ed. says:
A special attribute named xml:space may be attached to an element  
to signal an intention that in that element, white space should be  
preserved by applications. In valid documents, this attribute, like  
any other, MUST be declared if it is used. When declared, it MUST  
be given as an enumerated type whose values are one or both of  
"default" and "preserve".

http://www.w3.org/TR/REC-xml/#sec-white-space

So the vocabularies that have a DTD and wish to use the attribute  
must declare it in the DTD. For DTDless vocabularies, it doesn't  
exactly say whether the vocabularies should explicitly allow the  
attribute, but explicitly allowing it leaves no ambiguity.


(As a practical matter, it would be nice to explicitly remind  
conformance checker developers that the attribute is conforming.  
Otherwise, it is easily forgotten. :-)


--
Henri Sivonen
[EMAIL PROTECTED]
http://hsivonen.iki.fi/




Re: [whatwg] xml:space

2007-01-22 Thread Ian Hickson
On Mon, 22 Jan 2007, Henri Sivonen wrote:
>
> Some generic XML editors (e.g. oXygen) take liberties with reformatting 
> whitespace by default. When whitespace is significant, the reformatting 
> can be turned off using the xml:space='preserve' attribute.
> 
> Since this editor artifact is harmless in browsers and useful in 
> editors, it would be nice if the spec made it conforming at least on the 
>  element in XHTML5.

It's automatically conforming everywhere, no? Isn't it an XML thing?

-- 
Ian Hickson   U+1047E)\._.,--,'``.fL
http://ln.hixie.ch/   U+263A/,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


Re: [whatwg] xml:space

2007-01-22 Thread Henri Sivonen

On Jan 22, 2007, at 16:32, Henri Sivonen wrote:

Since this editor artifact is harmless in browsers and useful in  
editors, it would be nice if the spec made it conforming at least  
on the  element in XHTML5.


Suggested text:
The xml:space attribute may be used on XHTML elements of XML  
documents. Authors must not use the xml:space attribute in HTML  
documents. The xml:space attribute, if present, must have the literal  
value "default" or the literal value "preserve". The meaning of this  
attribute is outside the scope of this specification.


If that's too permissive, here's what would minimally cover my use case:
In XHTML (but not in HTML), the element pre may have the attribute  
xml:space. If the attribute is present, the value of the attribute  
must be "preserve".


The first conforms to XML 1.0 for sure. The latter may not exactly,  
depending on spec interpretation.


--
Henri Sivonen
[EMAIL PROTECTED]
http://hsivonen.iki.fi/




[whatwg] xml:space

2007-01-22 Thread Henri Sivonen
Some generic XML editors (e.g. oXygen) take liberties with  
reformatting whitespace by default. When whitespace is significant,  
the reformatting can be turned off using the xml:space='preserve'  
attribute.


Since this editor artifact is harmless in browsers and useful in  
editors, it would be nice if the spec made it conforming at least on  
the  element in XHTML5.


--
Henri Sivonen
[EMAIL PROTECTED]
http://hsivonen.iki.fi/