The SET command is used to set the "current" node in the presently loaded XML document. The "current" node is the node to which further queries (using the QUERY command) are applied.
When the document is loaded using the LOAD command, the current node is the document node. It is not mandatory to issue the SET command to change the current node. Providing the XPath expressions used in queries are formulated appropriately, they can be executed against the document node, and in many cases this will be all that is needed.
However, in more complex applications of the XMLQueryService, the SET command may be used, perhaps iteratively, to process specific sections of an XML document. The generated XPath expressions returned by the QUERY command when the special *XPATH or *XPATH_CONCISE values are specified may be used with the SET command to iteratively process subsets of the document contents.
Syntax:
|
Example
SET