XMLDocument
public class XMLDocument
- The
Queryable
protocol is adopted byXMLDocument
,HTMLDocument
andXMLElement
, 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.
-
String printed by
print
functionDeclaration
Swift
public var description: String
-
String printed by
debugPrint
functionDeclaration
Swift
public var debugDescription: String