Contents

objects(forXQuery:constants:)

Returns the objects resulting from executing an XQuery query upon the receiver.

Declaration

func objects(forXQuery xquery: String, constants: [String : Any]?) throws -> [Any]

Parameters

  • xquery:

    A string that expresses an XQuery query.

  • constants:

    A dictionary containing externally declared constants where the name of each constant variable is a key.

Discussion

The receiver acts as the context item for the query (”.”). If the receiver has been changed after parsing to have multiple adjacent text nodes, you should invoke the NSXMLElement method normalizeAdjacentTextNodesPreservingCDATA(_:) (with an argument of false) to coalesce the text nodes before querying.

See Also

Executing Queries