XMLDocument
public class XMLDocument
- The
Queryableprotocol is adopted byXMLDocument,HTMLDocumentandXMLElement, 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) -> XPathNodeSetParameters
xpathXPath selector string.
Return Value
An enumerable collection of results.
-
Returns the first elements matching an XPath selector, or
nilif there are no results.Declaration
Swift
public func firstChild(xpath xpath: String) -> XMLElement?Parameters
xpathThe XPath selector.
Return Value
The child element.
-
Returns the results for a CSS selector.
Declaration
Swift
public func css(css: String) -> XPathNodeSetParameters
cssThe CSS selector string.
Return Value
An enumerable collection of results.
-
Returns the first elements matching an CSS selector, or
nilif there are no results.Declaration
Swift
public func firstChild(css css: String) -> XMLElement?Parameters
cssThe 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
xpathThe XPath query string.
Return Value
The eval function result.
-
String printed by
printfunctionDeclaration
Swift
public var description: String -
String printed by
debugPrintfunctionDeclaration
Swift
public var debugDescription: String
XMLDocument Extension Reference