Re: Is whitespace significant in SOAP Messages?

Kevin Johnsrude asks:

>> One thing that is unclear when reading the SOAP and XML 
>> standards is under what circumstances whitespace is 
>> significant and should be preserved.

I believe the latest editors' draft of SOAP part 1 is clearer on this. 
From [1] 

"Element information items defined by this specification can have zero or 
more character information item children whose character code is amongst 
the whitespace characters as defined by [8]. Unless otherwise indicated, 
such character information items are considered insignificant. A SOAP 
receiver MUST ignore such insignificant character information items."

and [2]

"5.2.1 SOAP header block

Each SOAP header block element information item:

[...]

MAY have any number of character information item children. Child 
character information items whose character code is amongst the whitespace 
characters as defined by [8] are considered significant."

and [3]

"5.3.1 SOAP Body child Element
All child element information items of the SOAP Body element information 
item:

[...]

MAY have any number of character information item children. Child 
character information items whose character code is amongst the whitespace 
characters as defined by [8] are considered significant."


So, XML says that whitespaced is passed to the application.  SOAP is an 
XML application (or part of an application), and I think the SOAP spec is 
now clear.  In general, WS is insignificant when used to bracket envelope 
constructions such as <header>, but is significant within the context of 
individual header blocks or body child elements. 

I don't have time to copy all the text here, but the binding framework and 
other parts of the spec should make clear the responsibility of a 
transport binding when transmitting an envelope infoset, and the 
responsibilities of an intermediate node relaying a message.

Most likely, this text will appear in a formal working draft shortly. Hope 
this helps.


Noah


[1] http://www.w3.org/2000/xp/Group/1/10/11/soap12-part1.html#soapenv
[2] 
http://www.w3.org/2000/xp/Group/1/10/11/soap12-part1.html#soapheadblock
[3] http://www.w3.org/2000/xp/Group/1/10/11/soap12-part1.html#soapbodyel

------------------------------------------------------------------
Noah Mendelsohn                              Voice: 1-617-693-4036
IBM Corporation                                Fax: 1-617-693-8676
One Rogers Street
Cambridge, MA 02142
------------------------------------------------------------------

Received on Tuesday, 18 June 2002 23:43:35 UTC