# Interface Content

Content

A representation of a generic XML node.

### Implementing classes

| Name | Brief description |
|---|---|
| `Cdata` | A representation of an XML `CDATASection` node. |
| `Comment` | A representation of an XML `Comment` node. |
| `DocType` | A representation of an XML `DocumentType` node. |
| `Element` | A representation of an XML `Element` node. |
| `EntityRef` | A representation of an XML `EntityReference` node. |
| `ProcessingInstruction` | A representation of an XML `ProcessingInstruction` node. |
| `Text` | A representation of an XML `Text` node. |

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `asCdata()` | `Cdata|null` | Casts the node as a `CDATASection` node for the purposes of autocomplete. |
| `asComment()` | `Comment|null` | Casts the node as a `Comment` node for the purposes of autocomplete. |
| `asDocType()` | `DocType|null` | Casts the node as a `DocumentType` node for the purposes of autocomplete. |
| `asElement()` | `Element|null` | Casts the node as an `Element` node for the purposes of autocomplete. |
| `asEntityRef()` | `EntityRef|null` | Casts the node as a `EntityReference` node for the purposes of autocomplete. |
| `asProcessingInstruction()` | `ProcessingInstruction|null` | Casts the node as a `ProcessingInstruction` node for the purposes of autocomplete. |
| `asText()` | `Text|null` | Casts the node as a `Text` node for the purposes of autocomplete. |
| `detach()` | `Content|null` | Detaches the node from its parent `Element` node. |
| `getParentElement()` | `Element|null` | Gets the node's parent `Element` node. |
| `getType()` | `ContentTypes` | Gets the node's content type. |
| `getValue()` | `String` | Gets the text value of all nodes that are direct or indirect children of the node, in the order they appear in the document. |

## Detailed documentation

### `asCdata()`

Casts the node as a `CDATASection` node for the purposes of autocomplete. If the
node's `ContentTypes` is not already `CDATA`, this method returns `null`.

#### Return


`Cdata|null` --- The `CDATASection` node.

*** ** * ** ***

### `asComment()`

Casts the node as a `Comment` node for the purposes of autocomplete. If the node's
`ContentTypes` is not already `COMMENT`, this method returns `null`.

#### Return


`Comment|null` --- The `Comment` node, or `null` if the node's content type is not `COMMENT`.

*** ** * ** ***

### `asDocType()`

Casts the node as a `DocumentType` node for the purposes of autocomplete. If
the node's `ContentTypes` is not already `DOCTYPE`, this method returns `null`.

#### Return


`DocType|null` --- The `DocumentType` node.

*** ** * ** ***

### `asElement()`

Casts the node as an `Element` node for the purposes of autocomplete. If the node's
`ContentTypes` is not already `ELEMENT`, this method returns `null`.

#### Return


`Element|null` --- The `Element` node.

*** ** * ** ***

### `asEntityRef()`

Casts the node as a `EntityReference` node for the purposes of autocomplete.
If the node's `ContentTypes` is not already `ENTITYREF`, this method returns
`null`.

#### Return


`EntityRef|null` --- The `EntityReference` node.

*** ** * ** ***

### `asProcessingInstruction()`

Casts the node as a `ProcessingInstruction` node for the purposes of autocomplete. If
the node's `ContentTypes` is not already `PROCESSINGINSTRUCTION`, this method
returns `null`.

#### Return


`ProcessingInstruction|null` --- The `ProcessingInstruction` node.

*** ** * ** ***

### `asText()`

Casts the node as a `Text` node for the purposes of autocomplete. If the node's `ContentTypes` is not already `TEXT`, this method returns `null`.

#### Return


`Text|null` --- The `Text` node.

*** ** * ** ***

### `detach()`

Detaches the node from its parent `Element` node. If the node does not have a parent,
this method has no effect.

#### Return


`Content|null` --- The detached node.

*** ** * ** ***

### `getParentElement()`

Gets the node's parent `Element` node. If the node does not have a parent, this method
returns `null`.

#### Return


`Element|null` --- The parent `Element` node.

*** ** * ** ***

### `getType()`

Gets the node's content type.

#### Return


`ContentTypes` --- The node's content type.

*** ** * ** ***

### `getValue()`

Gets the text value of all nodes that are direct or indirect children of the node, in the order
they appear in the document.

#### Return


`String` --- The text value of all nodes that are direct or indirect children of the node.