type

XText

@Js
class XText : XNode

XText represents the character data inside an element.

constructors

make

Construct a text node with the specified value.

fields

cdata

If true then this text node was read/will be written as a CDATA section.

val

Character data for this text node.

methods

copy

Make a copy of this text node.

nodeType

Return the XNodeType.text.

toStr

Return the string value (truncated if it is long).

write

Write this node to the output stream.

Slot Details

cdata

Bool cdata

If true then this text node was read/will be written as a CDATA section. If set to true, then val must not contain the "]]>" substring.

copy

This copy()

Make a copy of this text node.

make

new make(Str val)

Construct a text node with the specified value.

nodeType

virtual override XNodeType nodeType()

Return the XNodeType.text.

toStr

virtual override Str toStr()

Return the string value (truncated if it is long).

val

Str val

Character data for this text node. If this text is to be written as a CDATA section, then this value must not contain the "]]>" substring.

write

virtual override Void write(OutStream out)

Write this node to the output stream. If this node is set to be written as a CDATA section and the val string contains the "]]>" substring then throw IOErr.