Instance Method

objectsForXQuery:error:

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

Declaration

- (NSArray *)objectsForXQuery:(NSString *)xquery error:(NSError * _Nullable *)error;

Parameters

xquery

A string that expresses an XQuery query.

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 .This convenience method invokes objectsForXQuery:constants:error: with nil for the constants dictionary.

See Also

Executing Queries

- nodesForXPath:error:

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

- objectsForXQuery:constants: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.