XMLElement

public class XMLElement : XMLNode
  • The Queryable protocol is adopted by XMLDocument, HTMLDocument and XMLElement, denoting that they can search for elements using XPath or CSS selectors.
  • Returns the results for an XPath selector.

    Declaration

    Swift

    public func xpath(xpath: String) -> XPathNodeSet

    Parameters

    xpath

    XPath selector string.

    Return Value

    An enumerable collection of results.

  • Returns the first elements matching an XPath selector, or nil if there are no results.

    Declaration

    Swift

    public func firstChild(xpath xpath: String) -> XMLElement?

    Parameters

    xpath

    The XPath selector.

    Return Value

    The child element.

  • Returns the results for a CSS selector.

    Declaration

    Swift

    public func css(css: String) -> XPathNodeSet

    Parameters

    css

    The CSS selector string.

    Return Value

    An enumerable collection of results.

  • Returns the first elements matching an CSS selector, or nil if there are no results.

    Declaration

    Swift

    public func firstChild(css css: String) -> XMLElement?

    Parameters

    css

    The CSS selector.

    Return Value

    The child element.

  • Returns the result for evaluating an XPath selector that contains XPath function.

    Declaration

    Swift

    public func eval(xpath xpath: String) -> XPathFunctionResult?

    Parameters

    xpath

    The XPath query string.

    Return Value

    The eval function result.