Subject: [xmpp] #69: handling of whitespace

From: "xmpp issue tracker" <[email-masked]>
Date: Tue, 22 Jun 2010 02:17:07 -0000

#69: handling of whitespace
--------------------------------+-------------------------------------------
 Reporter:  stpeter@…           |       Owner:  stpeter@…         
     Type:  defect              |      Status:  new               
 Priority:  minor               |   Milestone:                    
Component:  3920bis             |     Version:                    
 Severity:  In WG Last Call     |    Keywords:                    
--------------------------------+-------------------------------------------
 Regarding Section 11 (XML Usage), Matthew Wild commented: "The
 specification is also silent on preservation of whitespace. XML is rather
 vague on the matter but, as I read, does leave the door open for an
 application to swallow whitespace on elements that don't have the magic
 xml:space="preserve"."

-- 
Ticket URL: <http://trac.tools.ietf.org/wg/xmpp/trac/ticket/69>
xmpp <http://tools.ietf.org/xmpp/>

---

From: Peter Saint-Andre <[email-masked]>
Date: Wed, 23 Jun 2010 15:45:33 -0600

> #69: handling of whitespace

You make reference to Section 2.10 of the XML specification, which reads
in part:

   In editing XML documents, it is often convenient to use "white
   space" (spaces, tabs, and blank lines) to set apart the markup for
   greater readability. Such white space is typically not intended for
   inclusion in the delivered version of the document. On the other
   hand, "significant" white space that should be preserved in the
   delivered version is common, for example in poetry and source code.

   An XML processor MUST always pass all characters in a document that
   are not markup through to the application. A validating XML
   processor MUST also inform the application which of these characters
   constitute white space appearing in element content.

   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.

I suppose it's possible that in some kinds of XMPP message bodies
(human-readable IM and presence interactions), the sender might think
that whitespace is significant...

<message from='romeo' to='juliet' xml:space='preserve'>
  <body>                  I take thee at thy word:
Call me but love, and I'll be new baptized;
Henceforth I never will be Romeo.
  </body>
</message>

Two points:

1. It seems to me that we have the HTML-IM integration set (XEP-0071)
for such things.

2. Many IM clients already treat such whitespace as significant, such as
this paste from a client I just tested.

[15:33:19] <司馬 安平> let's
  see
    if
      this
        works....       ok?

However, to clarify this matter I propose that we add the following text
to draft-ietf-xmpp-3921bis (not 3920bis):

   A client MAY treat whitespace as significant (in accordance with the
   description found at Section 2.10 of [XML]) in the <body/> and
   <subject/> children of the XMPP message stanza, and in the <status/>
   child of the XMPP presence stanza.  Because such whitespace handling
   is a matter of implementation for the receieving application, a
   sending application SHOULD NOT use the 'xml:space' attribute to
   signal that whitespace characters are intended to be treated as
   significant.

But that's text for 3921bis, not 3920bis, and I haven't yet found the
time to complete my editor's review of that spec. In any case, I don't
see a need to say anything about this in 3920bis, because I think it's
an IM thing, not a core thing.

Therefore I shall mark this issue as "wontfix" for 3920bis.

Peter

-- 
Peter Saint-Andre
https://stpeter.im/

---

From: "xmpp issue tracker" <[email-masked]>
Date: Wed, 23 Jun 2010 21:47:42 -0000

#69: handling of whitespace
--------------------------------+-------------------------------------------
 Reporter:  stpeter@…           |        Owner:  stpeter@…         
     Type:  defect              |       Status:  closed            
 Priority:  minor               |    Milestone:                    
Component:  3920bis             |      Version:                    
 Severity:  In WG Last Call     |   Resolution:  fixed             
 Keywords:                      |  
--------------------------------+-------------------------------------------
Changes (by stpeter@…):

  * status:  new => closed
  * resolution:  => fixed

-- 
Ticket URL: <http://trac.tools.ietf.org/wg/xmpp/trac/ticket/69#comment:1>
xmpp <http://tools.ietf.org/xmpp/>