Instance Method

objectsForXQuery:constants:error:

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

Declaration

- (NSArray *)objectsForXQuery:(NSString *)xquery constants:(NSDictionary<NSString *,id> *)constants error:(NSError * _Nullable *)error;

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.

error

If query errors occur, indirectly returns an NSError object describing the errors.

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 NO) to coalesce the text nodes before querying.

See Also

Executing Queries

- nodesForXPath:error:

Returns the nodes resulting from executing an XPath query upon the receiver.

- objectsForXQuery:error:

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

XPath

Returns the XPath expression identifying the receiver’s location in the document tree.