XMLDocumentType

internal protocol XMLDocumentType : Node
  • HTML content of the document. May be nil if no content is available.

    Declaration

    Swift

    public final var html: String?
  • xml

    XML content of the document. May be nil if no content is available.

    Declaration

    Swift

    public final var xml: String?
  • Text content of the document. May be nil if no content is available.

    Declaration

    Swift

    public final var text: String?
  • HTML content of the document without the root tag. Only available if the html property is not nil.

    Declaration

    Swift

    public final var innerHTML: String?
  • Value of the attribute class of the root node. This property is nil if the node does not have a class attribute

    Declaration

    Swift

    public final var className: String?
  • Name of the tag for the root node.

    Note

    Setting this property to nil does not make any change.

    Declaration

    Swift

    public final var tagName: String?
  • Content of the document. May be nil if no content is available.

    Declaration

    Swift

    public final var content: String?
  • Searches for a node from a root node by provided XPath.

    Declaration

    Swift

    public final func search(byXPath xpath: String, namespaces: [String : String]?) -> XPathResult

    Parameters

    xpath

    XPath to search by.

    namespaces

    XML namespace to search in. Default value is nil.

    Return Value

    XPathResult enum case with an associated value.

  • Searches for a node from a root node by provided CSS selector.

    Declaration

    Swift

    public final func search(byCSSSelector selector: String, namespaces: [String : String]?) -> XPathResult

    Parameters

    selector

    CSS selector to search by.

    namespaces

    XML namespace to search in. Default value is nil.

    Return Value

    XPathResult enum case with an associated value.