Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.w3c.dom.ls
Interface ElementLS

public interface ElementLS

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 `ElementLS` interface provides a convenient mechanism by which the children of an element can be serialized to a string, or replaced by the result of parsing a provided string.

If the `ElementLS` interface is supported, the expectation is that an instance of the `ElementLS` interface can be obtained by using binding-specific casting methods on an instance of the `Element` interface, or by using the method `Node.getFeature` with parameter values `"LS-Load"` and `"3.0"` (respectively) on an `Element`, if the `Element` supports the feature `"Core"` version `"3.0"` defined in [DOM Level 3 Core] .

This interface is optional. If supported, implementations must support version `"3.0"` of the feature `"LS-ElementLS"`.

See also the Document Object Model (DOM) Level 3 Load and Save Specification.

Method Summary
`java.lang.String` | `getMarkupContent()` The content of the element in serialized form.
`void` | `setMarkupContent(java.lang.String markupContent)` The content of the element in serialized form.

Method Detail

### getMarkupContent

    public java.lang.String getMarkupContent()

  The content of the element in serialized form.
  When getting the value of this attribute, the children are serialized in document order and the serialized result is returned. This is equivalent of calling `DOMWriter.writeToString()` on all children in document order and appending the result of the individual results to a single string that is then returned as the value of this attribute.
  When setting the value of this attribute, all children of the element are removed, the provided string is parsed and the result of the parse operation is inserted into the element. This is equivalent of calling `DOMBuilder.parseWithContext()` passing in the provided string (through the input source argument), the `Element`, and the action `ACTION_REPLACE_CHILDREN`. If an error occures while parsing the provided string, the `Element`'s owner document's error handler will be called, and the `Element` is left with no children.
  Both setting and getting the value of this attribute assumes that the parameters in the DOMConfiguration object have their default values.

### setMarkupContent

    public void setMarkupContent(java.lang.String markupContent)

  The content of the element in serialized form.
  When getting the value of this attribute, the children are serialized in document order and the serialized result is returned. This is equivalent of calling `DOMWriter.writeToString()` on all children in document order and appending the result of the individual results to a single string that is then returned as the value of this attribute.
  When setting the value of this attribute, all children of the element are removed, the provided string is parsed and the result of the parse operation is inserted into the element. This is equivalent of calling `DOMBuilder.parseWithContext()` passing in the provided string (through the input source argument), the `Element`, and the action `ACTION_REPLACE_CHILDREN`. If an error occures while parsing the provided string, the `Element`'s owner document's error handler will be called, and the `Element` is left with no children.
  Both setting and getting the value of this attribute assumes that the parameters in the DOMConfiguration object have their default values.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1999-2003 Apache XML Project. All Rights Reserved.