var debugDescription: String
var description: String
var siblingIndex: Int
Get the list index of this node in its node sibling list. I.e. if this is the first node sibling, returns 0.
func absUrl(String) throws -> String
Get an absolute URL from a URL attribute that may be relative (i.e. an <a href>
or <img src>
).
func absUrl<T>(T) throws -> [UInt8]
func addChildren(Node...) throws
func addChildren([Node]) throws
func addChildren(Int, Node...) throws
func addChildren(Int, [Node]) throws
func addSiblingHtml(index: Int, String) throws
func after(Node) throws -> Node
Insert the specified node into the DOM after this node (i.e. as a following sibling).
func after(String) throws -> Node
Insert the specified HTML into the DOM after this node (i.e. as a following sibling).
func after(html: String) throws -> Node
Insert the specified HTML into the DOM after this node (i.e. as a following sibling).
func after(node: Node) throws -> Node
Insert the specified node into the DOM after this node (i.e. as a following sibling).
func attr(String) throws -> String
func attr([UInt8]) throws -> [UInt8]
Get an attribute’s value by its key. Case insensitive
func attr(String, String) throws -> Node
func attr([UInt8], [UInt8]) throws -> Node
Set an attribute (key=value). If the attribute already exists, it is replaced.
func before(Node) throws -> Node
Insert the specified node into the DOM before this node (i.e. as a preceding sibling).
func before(String) throws -> Node
Insert the specified HTML into the DOM before this node (i.e. as a preceding sibling).
func before([UInt8]) throws -> Node
Insert the specified HTML into the DOM before this node (i.e. as a preceding sibling).
func childNode(Int) -> Node
Get a child node by its 0-based index.
func childNodeSize() -> Int
Get the number of child nodes that this node holds.
func childNodesCopy() -> Array<Node>
Returns a deep copy of this node’s children. Changes made to these nodes will not be reflected in the original nodes
func copy(clone: Node) -> Node
func copy(clone: Node, parent: Node?) -> Node
func copy(parent: Node?) -> Node
func copy(with: NSZone?) -> Any
Create a stand-alone, deep copy of this node, and all of its children. The cloned node will have no siblings or parent node. As a stand-alone object, any changes made to the clone or any of its children will not impact the original node.
func equals(Node) -> Bool
Check if this node is the same instance of another (object identity test).
func getAttributes() -> Attributes?
Get all of the element’s attributes.
func getBaseUri() -> String
Get the base URI of this node.
func getBaseUriUTF8() -> [UInt8]
func getChildNodes() -> Array<Node>
Get this node’s children. Presented as an unmodifiable list: new children can not be added, but the child nodes themselves can be manipulated.
func hasAttr(String) -> Bool
Test if this element has an attribute. Case insensitive
func hasAttr([UInt8]) -> Bool
Test if this element has an attribute. Case insensitive
func hasChildNodes() -> Bool
func hasNextSibling() -> Bool
func hasSameValue(Node) throws -> Bool
Check if this node is has the same content as another node. A node is considered the same if its name, attributes and content match the other node; particularly its position in the tree does not influence its similarity.
func hash(into: inout Hasher)
The hash value.
func html(StringBuilder) throws -> StringBuilder
Write this node and its children to the given {@link Appendable}.
func indent(StringBuilder, Int, OutputSettings)
func nextSibling() -> Node?
Get this node’s next sibling.
func nodeName() -> String
Get the node name of this node. Use for debugging purposes and not logic switching (for that, use instanceof).
func nodeNameUTF8() -> [UInt8]
func outerHtml() throws -> String
Get the outer HTML of this node.
func outerHtml(StringBuilder) throws
func ownerDocument() -> Document?
Gets the Document associated with this Node.
func parent() -> Node?
Gets this node’s parent node.
func previousSibling() -> Node?
Get this node’s previous sibling.
func remove() throws
Remove (delete) this node from the DOM tree. If this node has children, they are also removed.
func removeAttr(String) throws -> Node
func removeAttr([UInt8]) throws -> Node
Remove an attribute from this element.
func removeChild(Node) throws
func reparentChild(Node) throws
func replaceChild(Node, Node) throws
func replaceWith(Node) throws
Replace this node in the DOM with the supplied node.
func setBaseUri(String) throws
Update the base URI of this node and all of its descendants.
func setBaseUri([UInt8]) throws
func setParentNode(Node) throws
func setSiblingIndex(Int)
func siblingNodes() -> Array<Node>
Retrieves this node’s sibling nodes. Similar to {@link #childNodes() node.parent.childNodes()}, but does not include this node (a node is not a sibling of itself).
func traverse(NodeVisitor) throws -> Node
Perform a depth-first traversal through this node and its descendants.
func wrap(String) throws -> Node?
Wrap the supplied HTML around this node.