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

XmlHttpRequest and DOM 3 LS

From: Philippe Le Hegaret <plh@w3.org>
Date: Thu, 19 May 2005 14:38:26 -0400
To: WWW DOM <www-dom@w3.org>
Message-Id: <1116527906.14629.246.camel@localhost>
There is to be lots of confusing between XmlHttpRequest and DOM 3 LS
nowadays, especially with the emergence of "Ajax". It seems it's worth
an entry in the DOM FAQ to clarify the differences.
Something along:
[[
DOM3 LS defines the LSParser [1] and LSSerializer [2] interfaces.
XmlHttpRequest was introduced in Internet Explorer. DOM 3 LS that do
provide synchronous and synchronous loading of the DOM tree as well as
saving capabilities but, unless the XmlHttpRequest object, without
control over the HTTP protocol (no user/passwd, no HTTP header, etc.).
DOM 3 LS provides other functionalities such as a better control over
the DOM tree being built or saved using the parameters and the filtering
mechanisms. The LSInputSource and LSOutputSource object provide also
better flexibility.
]]

Now, here is a proposal to add the missing functionality in DOM 3 LS: 

interface HTTPRequest {
  String passwd;
  String user;
  void setHTTPHeader(String header, String value);
}

Add a new DOMConfiguration parameter:
"http-request"
  [optional]
  A reference to a HTTPRequest object, or null. If the value of this
parameter is not null, the implementation will use it if a resource is
retrieved using the HTTP transport protocol.

The parameter is supported on LSParser.config and LSSerializer.config.
It has the limitation of being used for all resources being retrieved,
ie you can't change depending on the external entity being loading from
the same document. There is probably a security issue with user/passwd,
should they either be restricted to the domain of the root document
being retrieved?

then, to access the HTTP headers of the response:

interface HTTPResponse {
  int status;
  String getHTTPHeader(String value);
}

Add a new DOMConfiguration parameter:
"http-response"
 [optional]
 A reference to a HTTPResponse object, or null. If the value of this
parameter is not null, it contains the returned status code and http
headers provided during the retrieval of the root document using the
HTTP transport protocol.

The parameter is supported on Document.config.

Philippe
[1]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/7924f6be-c035-411f-acd2-79de7a711b38.asp


Received on Thursday, 19 May 2005 18:38:38 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:58 GMT