Text
public final class Text: TextNode
The Text class represents the textual content (termed character data in XML)
of an Element. If there is no markup inside an element’s content, the text is
contained in a single object implementing the Text protocol that is the only
child of the element. If there is markup, it is parsed into a sequence of
elements and Text nodes that form the array of children of the element.
-
The
nodeNameof aTextnode is#text.Declaration
Swift
public final let nodeName: String = "#text" -
The
attributesdictionary of aTextnode isnil.Declaration
Swift
public final let attributes: [String : String]? = nil
-
The string contents of this text node.
Declaration
Swift
public final var text: String
-
Creates a new
Textnode.Declaration
Swift
public init(text: String)Parameters
textThe string contents of this text node.
-
A text node calls
visit(self)on the visitor.Declaration
Swift
public func accept(_ visitor: Visitor)
View on GitHub
Install in Dash
Text Class Reference