Filters allow the user to "filter out" nodes. Each filter contains a user-written function that looks at a node and determines whether or not it should be filtered out. To use a filter, you create an iterator that uses the filter. The iterator applies the filter to each node, and if the filter rejects the node, the iterator skips over the node as though it were not present in the document. Filters are easy to write, since they need not know how to navigate the structure on which they operate, and they can be reused for different kinds of iterators that operate on different data structures.
specializes
enumerations
methods
enumeration FilterType
The values of the FilterType enumeration are used to identify the various types of node filters in the iXML implementation.
The iXMLNodeFilter::getType() method returns one of these values depending on the filter's actual type.
interface
if_ixml_node_filter
values
co_filter_other = 0
This is not an iXML filter but a filter implementing the iXMLNodeFilter interface.
co_filter_and = 1
This is a filter created via iXMLNode::createFilterAnd().
co_filter_or = 2
This is a filter created via iXMLNode::createFilterOr().
co_filter_not = 3
This is a filter created via iXMLNode::createFilterNot().
co_filter_node_type = 4
This is a filter created via iXMLNode::createFilterNodeType().
co_filter_name = 5
This is a filter created via iXMLNode::createFilterName().
co_filter_name_ns = 6
This is a filter created via iXMLNode::createFilterNameNS().
co_filter_attribute = 7
This is a filter created via iXMLNode::createFilterAttribute().
co_filter_attribute_ns = 8
This is a filter created via iXMLNode::createFilterAttributeNS().
co_filter_parent = 9
This is a filter created via iXMLNode::createFilterParent().
co_filter_ancestor = 10
This is a filter created via iXMLNode::createFilterAncestor().
abap signature
constants:
co_filter_other type I value 0,
co_filter_and type I value 1,
co_filter_or type I value 2,
co_filter_not type I value 3,
co_filter_node_type type I value 4,
co_filter_name type I value 5,
co_filter_name_ns type I value 6,
co_filter_attribute type I value 7,
co_filter_attribute_ns type I value 8,
co_filter_parent type I value 9,
co_filter_ancestor type I value 10.
method accept_node
This method applies this filter to the given node.
interface
if_ixml_node_filter
parameters
node
The node to check to see if it passes the filter or not.
return value
Returns true if the given node passed the filter, false otherwise.
abap signature
method accept_node
importing
node type ref to if_ixml_node
returning
value(rval) type boolean.
method clone
Creates a "clone" or copy of this filter.
interface
if_ixml_node_filter
return value
Returns a pointer to the copy of this filter.
abap signature
method clone
returning
value(rval) type ref to if_ixml_node_filter.
method get_type
Returns the type of this filter (see iXMLNodeFilter::FilterType).
interface
if_ixml_node_filter
return value
Returns the filter's type (see iXMLNodeFilter::FilterType).
abap signature
method get_type
returning
value(rval) type I.
method query_interface
Queries the specified interface.
interface
if_ixml_node_filter
parameters
iid
The interface ID of the interface to query.
return value
Returns a reference to the queried interface or null if no such interface is supported.
abap signature
method query_interface
importing
iid type I
returning
value(rval) type I.