|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
DOM Level 3 WD Experimental:
The DOM Level 3 specification is at the stage
of Working Draft, which represents work in
progress and thus may be updated, replaced,
or obsoleted by other documents at any time.
The DocumentLS
interface provides a mechanism by which the
content of a document can be serialized, or replaced with the DOM tree
produced when loading a URI, or parsing a string.
If the DocumentLS
interface is supported, the expectation
is that an instance of the DocumentLS
interface can be
obtained by using binding-specific casting methods on an instance of the
Document
interface, or by using the method
Node.getFeature
with parameter values "LS-Load"
and "3.0"
(respectively) on an Document
, if the
Document
supports the feature "Core"
version
"3.0"
defined in [DOM Level 3 Core]
This interface is optional. If supported, implementations are must
support version "3.0"
of the feature
"LS-DocumentLS"
.
See also the Document Object Model (DOM) Level 3 Load and Save Specification.
Method Summary | |
void |
abort()
If the document is currently being loaded as a result of the method load being invoked the loading and parsing is
immediately aborted. |
boolean |
getAsync()
Indicates whether the method DocumentLS.load() should be
synchronous or asynchronous. |
boolean |
load(java.lang.String uri)
Replaces the content of the document with the result of parsing the given URI. |
boolean |
loadXML(java.lang.String source)
Replace the content of the document with the result of parsing the input string, this method is always synchronous. |
java.lang.String |
saveXML(Node snode)
Save the document or the given node and all its descendants to a string (i.e. |
void |
setAsync(boolean async)
Indicates whether the method DocumentLS.load() should be
synchronous or asynchronous. |
Method Detail |
public boolean getAsync()
DocumentLS.load()
should be
synchronous or asynchronous. When the async attribute is set to
true
the load method returns control to the caller
before the document has completed loading. The default value of this
attribute is true
. Should the DOM spec define the
default value of this attribute? What if implementing both async and
sync IO is impractical in some systems? 2001-09-14. default is
false
but we need to check with Mozilla and IE.
2003-01-24. Checked with IE and Mozilla, default is true
.public void setAsync(boolean async) throws DOMException
DocumentLS.load()
should be
synchronous or asynchronous. When the async attribute is set to
true
the load method returns control to the caller
before the document has completed loading. The default value of this
attribute is true
. Should the DOM spec define the
default value of this attribute? What if implementing both async and
sync IO is impractical in some systems? 2001-09-14. default is
false
but we need to check with Mozilla and IE.
2003-01-24. Checked with IE and Mozilla, default is true
.DOMException
- NOT_SUPPORTED_ERR: Raised if the implementation doesn't support the
mode the attribute is being set to.public void abort()
load
being invoked the loading and parsing is
immediately aborted. The possibly partial result of parsing the
document is discarded and the document is cleared.public boolean load(java.lang.String uri)
ParseErrorEvent
).
If this method is called on a document that is currently loading, the
current load is interrupted and the new URI load is initiated.
DOMBuilder
interface are assumed to have their default
values with the exception that the feature "entities" is "false".uri
- The URI reference for the XML file to be loaded. If this is
a relative URI, the base URI used by the implementation is
implementation dependent.true
load
returns
true
if the document load was successfully initiated.
If an error occurred when initiating the document load
load
returns false
.If async is set to
false
load
returns true
if
the document was successfully loaded and parsed. If an error
occurred when either loading or parsing the URI load
returns false
.public boolean loadXML(java.lang.String source)
DOMBuilder
interface are
assumed to have their default values when invoking this method.source
- A string containing an XML document.true
if parsing the input string succeeded
without errors, otherwise false
.public java.lang.String saveXML(Node snode) throws DOMException
DOMWriter
interface are
assumed to have their default values when invoking this method.snode
- Specifies what to serialize, if this parameter is
null
the whole document is serialized, if it's
non-null the given node is serialized.null
in case an error
occured.DOMException
- WRONG_DOCUMENT_ERR: Raised if the node passed in as the node
parameter is from an other document.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |