Subtree Filtering
XML subtree filtering is a mechanism that allows an application to select particular XML subtrees to include in the
Conceptually, a subtree filter is comprised of zero or more element subtrees, which represent the filter selection criteria.At each containment level within a subtree, the set of sibling nodes is logically processed by the server to determine if its subtree and path of elements to the root are included in the filter output.
Each node specified in a subtree filter represents an inclusive filter.Only associated nodes in underlying data model(s) within the specified datastore on the server are selected by the filter.A node is selected if it matches the selection criteria and hierarchy of elements given in the filter data,except that the filter absolute path name is adjusted to start from the layer below
Response messages contain only the subtrees selected by the filter.Any selection criteria that were present in the request, within a particular selected subtree, are also included in the response.Note that some elements expressed in the filter as leaf nodes will be expanded (i.e., subtrees included) in the filter output.Specific data instances are not duplicated in the response in the event that the request contains multiple filter subtree expressions that select the same data.
Supported Situation
Section titled “Supported Situation”This section descripted the subtree filtering supported on AsterNOS.
AsterNOS has implemented one simple subtree filter, which can only be used to get data via get/get-config.There are currently some limitations when using subtree filter, which will be detailed descripted in subsequent chapters.
Container Node
Section titled “Container Node”When user use a subtree filter to filter container node data in get/get-config,all nodes under container will be return by server.If there are any sub-nodes under this container, it will be included in rpc-reply.
List Node
Section titled “List Node”When user use a subtree filter to filter list node data in get/get-config:
- If the key to list is specified, the corresponding list data will be returned by server.
- Otherwise, all existing lists are returned.
Leaf Node
Section titled “Leaf Node”Single leaf node in subtree filter is not supported currently, that means when user use a subtree filter to filter leaf node data in get/get-config, all sibling nodes will be returned in rpc-reply by server.
Leaf-List Node
Section titled “Leaf-List Node”When user use a subtree filter to filter leaf-list node data in get/get-config, no matter leaf is specified or not, all leaf-list will be returned in rpc-reply by server.