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

DocumentLS may be more than just a convenience

From: Steve Schafer <steve@fenestra.com>
Date: Tue, 18 Mar 2003 23:35:59 -0500
To: www-dom@w3.org
Message-ID: <i1sf7v096b4jqeibsllsfksr230nl6ocl8@4ax.com>

The description of the DOM3 Load and Save "convenience interfaces"
states that "The interfaces in this section provide no direct
functionality that can not be achieved with the load and save interfaces
defined in the earlier sections of this specification." But that doesn't
appear to be quite true. DocumentLS.load() and DocumentLS.loadXML() both
replace the contents of an existing document object with the results of
the parse. On the other hand, DOMBuilder.parse() and
DOMBuilder.parseURI() both return newly-instantiated document objects.

It would seem that DOMBuilder.parseWithContext() is capable of doing the
job, but the description of the "is" parameter explicitly states that
"The source document must be an XML fragment, i.e. anything except a
complete XML document."

So there doesn't seem to be any way of using the basic DOMBuilder
interface to replace the contents of an existing document object, short
of creating an entirely new document object and then importing all of
its nodes into the original document. And even that won't work if the
original document's DTD isn't the same as the new one's.

Steve Schafer
Fenestra Technologies Corp.
Received on Tuesday, 18 March 2003 23:36:10 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:11 UTC