W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2004

Re: LSParser.parse - stringData - encoding declaration

From: Philippe Le Hegaret <plh@w3.org>
Date: Fri, 27 Feb 2004 17:41:24 -0500
To: Kasimier Buchcik <kbuchcik@4commerce.de>
Cc: WWW DOM <www-dom@w3.org>
Message-Id: <1077921683.678.49.camel@jfouffa.w3.org>
On Wed, 2004-02-25 at 11:53, Kasimier Buchcik wrote:
> Hi,
> 
> I learned that the LSSerializer should generate an encoding declaration 
> of "UTF-16" if serializing a whole DOM document to a DOMString via 
> LSSerializer.writeToString.

Note that this depends on the value of the xml-declaration parameter.

> So just to have it black on white: does this imply the encoding 
> declaration *has to* be existent and *has to* state "UTF-16", if parsing 
> with LSParser.parse with an input.stringData holding a XML document - 
> otherwise an error would be reported?

We added the following on LSInput.characterStream (modulo the
"<code>stringData</code>") and LSInput.stringData:
[[
It is not a requirement to have an XML declaration when using
<code>stringData</code>. If an XML declaration is present, the value of
the encoding attribute will be ignored.
]]

Since the document is already represent as characters, there is no need
for encoding information anymore.

Philippe


Received on Friday, 27 February 2004 17:41:24 GMT

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