Anfang des Inhaltsbereichs

HintergrunddokumentationHintergrunddokumentation Interface if_ixml_element  Dokument im Navigationsbaum lokalisieren

By far the vast majority (apart from text) of objects that authors encounter when traversing a document are iXMLElement nodes.

Elements may have attributes associated with them; since the iXMLElement interface inherits from iXMLNode, the generic iXMLNode interface method getAttributes() may be used to retrieve the set of all attributes for an element. There are methods on the iXMLElement interface to retrieve either an iXMLAttribute object by name or directly an attribute value by name. iXMLAttribute objects should be retrieved in XML, where attributes may contain entity references, meaning that their values may be a fairly complex sub-tree. On the other hand, in HTML, where all attributes have simple string values, methods to directly access an attribute value can safely be used as a convenience.

specializes

enumerations

methods

 

 

method contains

This method returns true, if this element contains any of the specified node types.

You will typically use this function to determine whether an element is simple (i.e. it has only text content) or whether it is by itself complex (i.e. it contains other elements).

Only immediate child nodes are considered.

interface

if_ixml_element

parameters

node_types

An OR-combination of node type constants that specify which node types make this method return true.

abap signature

method contains

importing

node_types type I

returning

value(rval) type boolean.

 

 

method find_from_name

This method returns the first occurrance of an element with the specified name within the children of this element. The depth argument can be used to limit the depth of the search (0 searches all child nodes, 1 searches immediate child nodes only, 2 searches immediate child nodes and the child nodes' immediate children, etc.). If no matching element is found, null is returned.

The search order is BSF.

deprecated

This method has been replaced by the method find_from_name_ns(). It is still supported for compatibility reasons, but we recommend to switch to the replacement method, since find_from_name() may not be supported any more in a future release.

interface

if_ixml_element

parameters

name

The name (local part) of the element to search.

namespace [ default '' ]

The namespace (prefix) of the element to search or null for no namespace.

depth [ default 0 ]

The search depth (0..n) below this element.

return value

Returns the first matching element in this elements's children.

abap signature

method find_from_name

importing

name type string

namespace type string default ''

depth type I default 0

returning

value(rval) type ref to if_ixml_element.

 

 

method find_from_name_ns

This method returns the first occurrance of an element with the specified name within the children of this element. The depth argument can be used to limit the depth of the search (0 searches all child nodes, 1 searches immediate child nodes only, 2 searches immediate child nodes and the child nodes' immediate children, etc.). If no matching element is found, null is returned.

The search order is BSF.

interface

if_ixml_element

parameters

name

The name (local part) of the element to search.

uri [ default '' ]

The namespace URI of the element to search or null for no namespace.

depth [ default 0 ]

The search depth (0..n) below this element.

return value

Returns the first matching element in this elements's children.

abap signature

method find_from_name_ns

importing

name type string

uri type string default ''

depth type I default 0

returning

value(rval) type ref to if_ixml_element.

 

 

method find_from_path

This method returns the first element matching the given path. When specifying the path, the following scheme has to be used:

1. A path is build from path components, separated by slashes ('/')

2. A path starting with a slash ('/') starts at the root DOM tree.

3. A path not starting with a slash starts at the child elements of the element on which this method is invoked.

4. A path component '..' refers to the parent element of the current location in the path

5. A path component '*' matches any element at the current location in the path

6. Tag names can be given as qualified names (XML Namespaces) by separating the namespace prefix and the local name with a colon (':').

interface

if_ixml_element

parameters

path

The path identifying the element to return.

return value

Returns the element matching the given path or null if no such node exists.

abap signature

method find_from_path

importing

path type string

returning

value(rval) type ref to if_ixml_element.

 

 

method find_from_path_ns

This method returns the first element matching the given path. When specifying the path, the following scheme has to be used:

1. A path is build from path components, separated by slashes ('/')

2. A path starting with a slash ('/') starts at the root DOM tree.

3. A path not starting with a slash starts at the child elements of the element on which this method is invoked.

4. A path component '..' refers to the parent element of the current location in the path

5. A path component '*' matches any element at the current location in the path

6. Tag names can be given as qualified names (XML Namespaces) by separating the namespace URI and the local name with a colon (':'). If the namespace URI contains the '/' (slash) character you have to enclose the complete qualified name in double-quotes ("<namespaceURI>:<localName>")).

interface

if_ixml_element

parameters

path

The path identifying the element to return.

default_uri

A default namespace URI to be used for all unqualified names in the path.

return value

Returns the element matching the given path or null if no such node exists.

abap signature

method find_from_path_ns

importing

path type string

default_uri type string

returning

value(rval) type ref to if_ixml_element.

 

 

method get_attribute

This method returns the value of the iXMLAttribute node with the specified name or null if no attribute with that name exists for this element.

deprecated

This method has been replaced by the method get_attribute_ns(). It is still supported for compatibility reasons, but we recommend to switch to the replacement method, since get_attribute() may not be supported any more in a future release.

interface

if_ixml_element

parameters

name

The name (local part) of the attribute for which to return the value.

namespace [ default '' ]

The namespace (prefix) of the attribute for which to return the value or null.

return value

Returns the value of the specified attribute or null if no such attribute exists.

abap signature

method get_attribute

importing

name type string

namespace type string default ''

returning

value(rval) type string.

 

 

method get_attribute_node

This method returns the iXMLAttribute node with the specified name or null if no attribute with that name exists for this element.

deprecated

This method has been replaced by the method get_attribute_node_ns(). It is still supported for compatibility reasons, but we recommend to switch to the replacement method, since get_attribute_node() may not be supported any more in a future release.

interface

if_ixml_element

parameters

name

The name (local part) of the attribute to return.

namespace [ default '' ]

The namespace (prefix) of the attribute to return or null.

return value

Returns the iXMLAttribute node with the given name or null if no such attribute exists.

abap signature

method get_attribute_node

importing

name type string

namespace type string default ''

returning

value(rval) type ref to if_ixml_attribute.

 

 

method get_attribute_node_ns

This method returns the iXMLAttribute node with the specified name or null if no attribute with that name exists for this element.

interface

if_ixml_element

parameters

name

The name (local part) of the attribute to return.

uri [ default '' ]

The namespace URI of the attribute to return or null.

return value

Returns the iXMLAttribute node with the given name or null if no such attribute exists.

abap signature

method get_attribute_node_ns

importing

name type string

uri type string default ''

returning

value(rval) type ref to if_ixml_attribute.

 

 

method get_attribute_ns

This method returns the value of the iXMLAttribute node with the specified name or null if no attribute with that name exists for this node.

interface

if_ixml_element

parameters

name

The name (local part) of the attribute for which to return the value.

uri [ default '' ]

The namespace URI of the attribute for which to return the value or null.

return value

Returns the value of the specified attribute or null if no such attribute exists.

abap signature

method get_attribute_ns

importing

name type string

uri type string default ''

returning

value(rval) type string.

 

 

method get_content_as_string

This method traverses this element's content and constructs a string representation of it, that does only contain iXMLText, iXMLCDATASection and iXMLEntityRef nodes.

interface

if_ixml_element

abap signature

method get_content_as_string

returning

value(rval) type string.

 

 

method get_elements_by_tag_name

Returns an iXMLNodeCollection (this differs from the W3C DOM!) of all the child elements of this node with a given tag name in the order in which they would be encountered in a preorder traversal of the document tree.

deprecated

This method has been replaced by the method get_elements_from_tag_name_ns(). It is still supported for compatibility reasons, but we recommend to switch to the replacement method, since get_elements_by_tag_name() may not be supported any more in a future release.

interface

if_ixml_element

parameters

name

The name (local part) identifying the elements to get.

namespace [ default '' ]

The namespace (prefix) identifying the elements to get or null.

depth [ default 0 ]

The maximum depth to traverse (0: traverse complete subtree, 1: traverse immediate child nodes only, ...).

return value

Returns an iXMLNodeCollection containing all matching iXMLElement objects.

abap signature

method get_elements_by_tag_name

importing

name type string

namespace type string default ''

depth type I default 0

returning

value(rval) type ref to if_ixml_node_collection.

 

 

method get_elements_by_tag_name_ns

Returns an iXMLNodeCollection (this differs from the W3C DOM!) of all the child elements of this node with a given tag name in the order in which they would be encountered in a preorder traversal of the document tree.

interface

if_ixml_element

parameters

name

The name (local part) identifying the elements to get.

uri [ default '' ]

The namespace URI identifying the elements to get or null.

depth [ default 0 ]

The maximum depth to traverse (0: traverse complete subtree, 1: traverse immediate child nodes only, ...).

return value

Returns an iXMLNodeCollection containing all matching iXMLElement objects.

abap signature

method get_elements_by_tag_name_ns

importing

name type string

uri type string default ''

depth type I default 0

returning

value(rval) type ref to if_ixml_node_collection.

 

 

method normalize

Puts all iXMLText nodes in the full depth of the sub-tree underneath this iXMLElement into a "normal" form where only markup (e.g., tags, comments, processing instructions, CDATA sections, and entity references) separates iXMLText nodes, i.e., there are no adjacent iXMLText nodes. This can be used to ensure that the DOM view of a document is identical to how it would look if saved and re-loaded, and is useful when operations (such as XPointer lookups) that depend on a particular document tree structure are to be used.

interface

if_ixml_element

abap signature

method normalize.

 

 

method remove_attribute

This method removes this element's attribute identified by name if such an attribute exists.

deprecated

This method has been replaced by the method remove_attribute_ns(). It is still supported for compatibility reasons, but we recommend to switch to the replacement method, since remove_attribute() may not be supported any more in a future release.

interface

if_ixml_element

parameters

name

The name (local part) of the attribute to remove.

namespace [ default '' ]

The namespace (prefix) of the attribute to remove or null.

return value

Returns one of the following return codes:

ixml_mr_dom_ok = 0

The attribute has been removed successfully.

ixml_mr_dom_invalid_arg = 0x00020003L

One or more of the given arguments are invalid.

ixml_mr_dom_not_found = 0x0002000aL

No attribute with the given name could be found.

ixml_mr_dom_not_allowed = 0x00020008L

This element doesn't allow to remove this attribute.

abap signature

method remove_attribute

importing

name type string

namespace type string default ''

returning

value(rval) type I.

 

 

method remove_attribute_node

This method removes the given iXMLAttribute node from this element's attribute list.

deprecated

This method has been replaced by the method remove_attribute_node_ns(). It is still supported for compatibility reasons, but we recommend to switch to the replacement method, since remove_attribute_node() may not be supported any more in a future release.

interface

if_ixml_element

parameters

old_attr

The Attribute node to remove from the element.

return value

Returns one of the following return codes:

ixml_mr_dom_ok = 0

The attribute node has been removed successfully.

ixml_mr_dom_invalid_arg = 0x00020003L

One or more of the given arguments are invalid.

ixml_mr_dom_not_found = 0x0002000aL

The given attribute couldn't be found in this element's set of attribute.

abap signature

method remove_attribute_node

importing

old_attr type ref to if_ixml_attribute

returning

value(rval) type I.

 

 

method remove_attribute_node_ns

This method removes the given iXMLAttribute node from this element's attribute list.

interface

if_ixml_element

parameters

old_attr

The Attribute node to remove from the element.

return value

Returns one of the following return codes:

ixml_mr_dom_ok = 0

The attribute node has been removed successfully.

ixml_mr_dom_invalid_arg = 0x00020003L

One or more of the given arguments are invalid.

ixml_mr_dom_not_found = 0x0002000aL

The given attribute couldn't be found in this element's set of attribute.

abap signature

method remove_attribute_node_ns

importing

old_attr type ref to if_ixml_attribute

returning

value(rval) type I.

 

 

method remove_attribute_ns

This method removes this element's attribute identified by name if such an attribute exists.

interface

if_ixml_element

parameters

name

The name (local part) of the attribute to remove.

uri [ default '' ]

The namespace URI of the attribute to remove or null.

return value

Returns one of the following return codes:

ixml_mr_dom_ok = 0

The attribute has been removed successfully.

ixml_mr_dom_invalid_arg = 0x00020003L

One or more of the given arguments are invalid.

ixml_mr_dom_not_found = 0x0002000aL

No attribute with the given name could be found.

ixml_mr_dom_not_allowed = 0x00020008L

This element doesn't allow to remove this attribute.

abap signature

method remove_attribute_ns

importing

name type string

uri type string default ''

returning

value(rval) type I.

 

 

method set_attribute

This method sets this element's attribute specified by name to the given value.

deprecated

This method has been replaced by the method set_attribute_ns(). It is still supported for compatibility reasons, but we recommend to switch to the replacement method, since set_attribute() may not be supported any more in a future release.

interface

if_ixml_element

parameters

name

The name (local part) of the attribute for which to set the value.

namespace [ default '' ]

The namespace (prefix) of the attribute for which to set the value or null.

value [ default '' ]

The value to set for the attribute.

return value

Returns one of the following return codes:

ixml_mr_dom_ok = 0

The attribute's value has been set successfully.

ixml_mr_dom_invalid_arg = 0x00020003L

One or more of the given arguments are invalid.

ixml_mr_dom_not_allowed = 0x00020008L

This element doesn't allow to set this attribute.

abap signature

method set_attribute

importing

name type string

namespace type string default ''

value type string default ''

returning

value(rval) type I.

 

 

method set_attribute_node

This method adds the given iXMLAttribute node to this element's attributes. If an attribute with the same name as newAttr exists already, this existing iXMLAttribute node is replaced by newAttr.

interface

if_ixml_element

parameters

new_attr

The Attribute node representing the attribute to set.

return value

Returns one of the following return codes:

ixml_mr_dom_ok = 0

The attribute has been set successfully.

ixml_mr_dom_invalid_arg = 0x00020003L

The given argument is invalid.

ixml_mr_dom_not_allowed = 0x00020008L

This element doesn't allow to set this attribute.

abap signature

method set_attribute_node

importing

new_attr type ref to if_ixml_attribute

returning

value(rval) type I.

 

 

method set_attribute_node_ns

This method adds the given iXMLAttribute node to this element's attributes. If an attribute with the same name as newAttr exists already, this existing iXMLAttribute node is replaced by newAttr.

interface

if_ixml_element

parameters

new_attr

The Attribute node representing the attribute to set.

return value

Returns one of the following return codes:

ixml_mr_dom_ok = 0

The attribute has been set successfully.

ixml_mr_dom_invalid_arg = 0x00020003L

The given argument is invalid.

ixml_mr_dom_not_allowed = 0x00020008L

This element doesn't allow to set this attribute.

abap signature

method set_attribute_node_ns

importing

new_attr type ref to if_ixml_attribute

returning

value(rval) type I.

 

 

method set_attribute_ns

This method sets this element's attribute specified by name to the given value.

interface

if_ixml_element

parameters

name

The name (local part) of the attribute for which to set the value.

prefix [ default '' ]

The namespace prefix of the attribute for which to set the value or null.

uri [ default '' ]

The namespace URI of the attribute for which to set the value or null.

value [ default '' ]

The value to set for the attribute.

return value

Returns one of the following return codes:

ixml_mr_dom_ok = 0

The attribute's value has been set successfully.

ixml_mr_dom_invalid_arg = 0x00020003L

One or more of the given arguments are invalid.

ixml_mr_dom_not_allowed = 0x00020008L

This element doesn't allow to set this attribute.

abap signature

method set_attribute_ns

importing

name type string

prefix type string default ''

uri type string default ''

value type string default ''

returning

value(rval) type I.

 

 

method append_child

Adds a child node to the end of the list of children for this node. If the newChild is already in the tree, it is first removed.

interface

if_ixml_element

parameters

new_child

The child node to append.

return value

Returns one of the following return codes:

ixml_mr_dom_ok = 0

The given node has been appended successfully.

ixml_mr_dom_invalid_arg = 0x00020003L

The given argument is invalid.

abap signature

method append_child

importing

new_child type ref to if_ixml_node

returning

value(rval) type I.

 

 

method clone

Creates a "clone" or copy of this node and its child nodes down to the given depth (0..n).

interface

if_ixml_element

parameters

depth [ default -1 ]

The depth of the subtree of this node to copy. -1 will copy all child nodes (the complete sub-tree), 0 will not copy any child nodes, 1 will copy all immediate child nodes, etc.

return value

Returns a pointer to the copy of this node.

abap signature

method clone

importing

depth type I default -1

returning

value(rval) type ref to if_ixml_node.

 

 

method create_filter_ancestor

Creates a new node filter that is applied to all ancestors of the current node to be accepted by this filter. For a node in order to be accepted, one of the node's ancestor nodes has to be accepted by the filter given in the parameter filterAncestor of this method.

Please be aware that this filter is potentially expensive in computational cost since for each node the path to the root node is traversed!

interface

if_ixml_element

parameters

filter_ancestor

The filter to apply to all ancestor nodes.

return value

Returns an interface pointer to the new filter, or null if an error occured.

abap signature

method create_filter_ancestor

importing

filter_ancestor type ref to if_ixml_node_filter

returning

value(rval) type ref to if_ixml_node_filter.

 

 

method create_filter_and

Creates a new node filter combining the two given filters in an AND-operation, i.e. in order for a node to be accepted by this filter, it has to be accepted by filter1 and filter2. If one of the two filters is already an AND-combination of filters, the other one is simply added to this filter and no new filter instance is created.

interface

if_ixml_element

parameters

filter1

The first filter to AND-combine in this filter.

filter2

The second filter to AND-combine in this filter.

return value

Returns an interface pointer to the new filter (or filter1 or filter2), or null if an error occured.

abap signature

method create_filter_and

importing

filter1 type ref to if_ixml_node_filter

filter2 type ref to if_ixml_node_filter

returning

value(rval) type ref to if_ixml_node_filter.

 

 

method create_filter_attribute

Deprecated (use createFilterAttributeNS() for namespace supprot). Creates a new node filter that can be used to filter nodes which have an attribute matching the specified criteria. In order to be accepted by this filter, a node must have an attribute with the given name. If the specified value is null, any attribute with the given name will match, otherwise only those which also have a match (case-sensitive) of the attribute's value.

deprecated

This method has been replaced by the method create_filter_attribute_ns(). It is still supported for compatibility reasons, but we recommend to switch to the replacement method, since create_filter_attribute() may not be supported any more in a future release.

interface

if_ixml_element

parameters

name

The name (local part) of the attribute that must defined for all nodes being accepted by this filter.

namespace [ default '' ]

The namespace (prefix) of the attribute that must be matched by all nodes being accepted by this filter or null if no namespace is given.

value [ default '' ]

The value the attribute has to match (case-sensitive) or null, if any value is sufficient.

return value

Returns an interface pointer to the new filter, or null if an error occured.

abap signature

method create_filter_attribute

importing

name type string

namespace type string default ''

value type string default ''

returning

value(rval) type ref to if_ixml_node_filter.

 

 

method create_filter_attribute_ns

Deprecated (use createFilterAttributeNS() for namespace supprot). Creates a new node filter that can be used to filter nodes which have an attribute matching the specified criteria. In order to be accepted by this filter, a node must have an attribute with the given name. If the specified value is null, any attribute with the given name will match, otherwise only those which also have a match (case-sensitive) of the attribute's value.

interface

if_ixml_element

parameters

name

The name (local part) of the attribute that must defined for all nodes being accepted by this filter.

uri [ default '' ]

The namespace URI of the attribute that must be matched by all nodes being accepted by this filter or null if no namespace is given.

value [ default '' ]

The value the attribute has to match (case-sensitive) or null, if any value is sufficient.

return value

Returns an interface pointer to the new filter, or null if an error occured.

abap signature

method create_filter_attribute_ns

importing

name type string

uri type string default ''

value type string default ''

returning

value(rval) type ref to if_ixml_node_filter.

 

 

method create_filter_name

Deprecated (use createFilterNameNS() for namespace support). Creates a new node filter that can be used to filter nodes that match the specified name.

deprecated

This method has been replaced by the method create_filter_name_ns(). It is still supported for compatibility reasons, but we recommend to switch to the replacement method, since create_filter_name() may not be supported any more in a future release.

interface

if_ixml_element

parameters

name

The name (local part) that must be matched by all nodes being accepted by this filter.

namespace [ default '' ]

Deprecated: The namespace (prefix) that must be matched by all nodes being accepted by this filter or null if no namespace is given.

return value

Returns an interface pointer to the new filter, or null if an error occured.

abap signature

method create_filter_name

importing

name type string

namespace type string default ''

returning

value(rval) type ref to if_ixml_node_filter.

 

 

method create_filter_name_ns

Creates a new node filter that can be used to filter nodes that match the specified name.

interface

if_ixml_element

parameters

name

The name (local part) that must be matched by all nodes being accepted by this filter.

uri [ default '' ]

The namespace URI that must be matched by all nodes being accepted by this filter or null if no namespace is given.

return value

Returns an interface pointer to the new filter, or null if an error occured.

abap signature

method create_filter_name_ns

importing

name type string

namespace type string default ''

returning

value(rval) type ref to if_ixml_node_filter.

 

 

method create_filter_node_type

Creates a new node filter that can be used to filter nodes of a given node type (see iXMLNode::NodeType). In order to be accepted by this filter, a node has to be of one of the node types specified in the parameter nodeTypes of this method.

interface

if_ixml_element

parameters

node_types

An OR-combination of all node types to be accepted by this filter.

return value

Returns an interface pointer to the new filter, or null if an error occured.

abap signature

method create_filter_node_type

importing

node_types type I

returning

value(rval) type ref to if_ixml_node_filter.

 

 

method create_filter_not

Creates a new node filter that implements a logical NOT-operation on the given filter, i.e. in order for a node to be accepted by this filter, it has to be rejected by the filter specified by the parameter filterNot.

interface

if_ixml_element

parameters

filter_not

The filter to negate in this filter.

return value

Returns an interface pointer to the new filter, or null if an error occured.

abap signature

method create_filter_not

importing

filter_not type ref to if_ixml_node_filter

returning

value(rval) type ref to if_ixml_node_filter.

 

 

method create_filter_or

Creates a new node filter combining the two given filters in an OR-operation, i.e. in order for a node to be accepted by this filter, it has to be accepted by either filter1 or filter2. If one of the two filters is already an OR-combination of filters, the other one is simply added to this filter and no new filter instance is created.

interface

if_ixml_element

parameters

filter1

The first filter to OR-combine in this filter.

filter2

The second filter to OR-combine in this filter.

return value

Returns an interface pointer to the new filter (or filter1 or filter2), or null if an error occured.

abap signature

method create_filter_or

importing

filter1 type ref to if_ixml_node_filter

filter2 type ref to if_ixml_node_filter

returning

value(rval) type ref to if_ixml_node_filter.

 

 

method create_filter_parent

Creates a new node filter that is applied to the parent node of the current node to be accepted by this filter. For a node in order to be accepted, the node's parent node has to be accepted by the filter given in the parameter filterParent of this method.

interface

if_ixml_element

parameters

filter_parent

The filter to apply to the parent nodes.

return value

Returns an interface pointer to the new filter, or null if an error occured.

abap signature

method create_filter_parent

importing

filter_parent type ref to if_ixml_node_filter

returning

value(rval) type ref to if_ixml_node_filter.

 

 

method create_iterator

Creates a new tree iterator which traverses the DOM subtree rooted at this node in a DFS (depth-first search) manner from left to right. The depth parameter can be used to control the depth of the traversal (0: traverse complete subtree, 1: traverse immediate child nodes, 2: traverse down 2 levels, n: traverse down n levels...).

The iterator starts the iteration at this node.

interface

if_ixml_element

parameters

depth [ default 0 ]

The maximum depth to traverse (0: traverse complete subtree).

return value

Returns an interface pointer to the new iterator, or null if an error occured.

abap signature

method create_iterator

importing

depth type I default 0

returning

value(rval) type ref to if_ixml_node_iterator.

 

 

method create_iterator_filtered

Creates a new tree iterator which traverses the DOM subtree rooted at this node in a DFS (depth-first search) manner from left to right. The depth parameter can be used to control the depth of the traversal (0: traverse complete subtree, 1: traverse immediate child nodes, 2: traverse down 2 levels, n: traverse down n levels...). If a filter is specified, only nodes accepted by the filter are returned by the iterator.

The iterator starts the iteration at this node.

interface

if_ixml_element

parameters

filter

The (optional) filter to use when iterating; may be null.

depth [ default 0 ]

The maximum depth to traverse (0: traverse complete subtree).

return value

Returns an interface pointer to the new iterator, or null if an error occured.

abap signature

method create_iterator_filtered

importing

filter type ref to if_ixml_node_filter

depth type I default 0

returning

value(rval) type ref to if_ixml_node_iterator.

 

 

method create_rev_iterator

Creates a new reverse tree iterator which traverses the DOM subtree rooted at this node in a DFS (depth-first search) manner from right to left (hence, reverse). The depth parameter can be used to control the depth of the traversal (0: traverse complete subtree, 1: traverse immediate child nodes, 2: traverse down 2 levels, n: traverse down n levels...).

The iterator starts the iteration at this node.

interface

if_ixml_element

parameters

depth [ default 0 ]

The maximum depth to traverse (0: traverse complete subtree).

return value

Returns an interface pointer to the new iterator, or null if an error occured.

abap signature

method create_rev_iterator

importing

depth type I default 0

returning

value(rval) type ref to if_ixml_node_iterator.

 

 

method create_rev_iterator_filtered

Creates a new reverse tree iterator which traverses the DOM subtree rooted at this node in a DFS (depth-first search) manner from right to left (hence, reverse). The depth parameter can be used to control the depth of the traversal (0: traverse complete subtree, 1: traverse immediate child nodes, 2: traverse down 2 levels, n: traverse down n levels...). If a filter is specified, only nodes accepted by the filter are returned by the iterator.

The iterator starts the iteration at this node.

interface

if_ixml_element

parameters

filter

The (optional) filter to use when iterating; may be null.

depth [ default 0 ]

The maximum depth to traverse (0: traverse complete subtree).

return value

Returns an interface pointer to the new iterator, or null if an error occured.

abap signature

method create_rev_iterator_filtered

importing

filter type ref to if_ixml_node_filter

depth type I default 0

returning

value(rval) type ref to if_ixml_node_iterator.

 

 

method find_from_gid

This method returns the node with the specified generated ID (GID) within the children of this node. The depth argument can be used to limit the depth of the search (0 searches all child nodes, 1 searches immediate child nodes only, 2 searches immediate child nodes and the child nodes' immediate children, etc.). If no matching node is found, null is returned.

The search order is BSF.

interface

if_ixml_element

parameters

gid

The generated ID (GID) of the node to search.

depth [ default 0 ]

The search depth (0..n) below this node.

return value

Returns the first matching node in this node's children.

abap signature

method find_from_gid

importing

gid type I

depth type I default 0

returning

value(rval) type ref to if_ixml_node.

 

 

method get_attributes

This method returns a pointer to a iXMLNamedNodeMap containing this node's attribute nodes. If this node has no attributes, an empty iXMLNamedNodeMap is returned. Be aware that only a few node types have attributes (i.e. iXMLElement and iXMLPIParsed nodes).

interface

if_ixml_element

return value

Returns a pointer to an iXMLNamedNodeMap containing this node's attributes (may be empty).

abap signature

method get_attributes

returning

value(rval) type ref to if_ixml_named_node_map.

 

 

method get_children

Returns a list (iXMLNodeList) of the child nodes of this node. If this node has no child nodes, an empty list is returned.

interface

if_ixml_element

return value

Returns a list enumerating this node's child nodes.

abap signature

method get_children

returning

value(rval) type ref to if_ixml_node_list.

 

 

method get_column

Returns the column of the node in the input stream it was parsed from. If the node has been created dynamically, the value 0 is returned.

interface

if_ixml_element

return value

Returns the column [0..n] of the node in the input stream it was parsed from or 0 if the node was created dynamically (so there is no source position).

abap signature

method get_column

returning

value(rval) type I.

 

 

method get_depth

This method returns the maximum depth of the subtree formed by this node and its children. The depth ranges from 0 to n (0 = node has no children).

Whereas getHeight() measures upwards towards the tree's root node, getDepth() measures downwards.

interface

if_ixml_element

return value

Returns the depth of this node.

abap signature

method get_depth

returning

value(rval) type I.

 

 

method get_first_child

This method returns a pointer to this node's first child node.

interface

if_ixml_element

return value

Returns this node's first child node.

abap signature

method get_first_child

returning

value(rval) type ref to if_ixml_node.

 

 

method get_gid

This method returns a generated ID (GID) for this node. The GID is independent of a possible ID attribute of an Element node and can be used to uniquely identify nodes within a DOM tree instance. The GID of a node is only constant for the lifetime of the node's instance, i.e. parsing an XML document twice might result in the same logical node having different GIDs each time.

interface

if_ixml_element

return value

Returns the GID of this node.

abap signature

method get_gid

returning

value(rval) type I.

 

 

method get_height

This method returns the height of this node in the DOM tree, i.e. the distance to the root of the node hierarchy. The height of a node ranges from 0 to n (0 = node is root node).

Whereas getDepth() measures downwards in a subtree, getHeight() measures upwards.

interface

if_ixml_element

return value

Returns the height of this node.

abap signature

method get_height

returning

value(rval) type I.

 

 

method get_last_child

This method returns a pointer to this node's last child node.

interface

if_ixml_element

return value

Returns this node's last child node.

abap signature

method get_last_child

returning

value(rval) type ref to if_ixml_node.

 

 

method get_line

Returns the line of the node in the input stream it was parsed from. If the node has been created dynamically, the value 0 is returned.

interface

if_ixml_element

return value

Returns the line [1..n] of the node in the input stream it was parsed from or 0 if the node was created dynamically (so there is no source position).

abap signature

method get_line

returning

value(rval) type I.

 

 

method get_name

Returns the name (local part) of this node.

interface

if_ixml_element

return value

Returns the node's name.

abap signature

method get_name

returning

value(rval) type string.

 

 

method get_namespace

Returns the namespace (prefix) of this node.

deprecated

This method has been replaced by the method get_namespace_prefix(). It is still supported for compatibility reasons, but we recommend to switch to the replacement method, since get_namespace() may not be supported any more in a future release.

interface

if_ixml_element

return value

Returns the node's namespace (prefix).

abap signature

method get_namespace

returning

value(rval) type string.

 

 

method get_namespace_context

Returns the namespace context of this node.

interface

if_ixml_element

return value

Returns the node's namespace context.

abap signature

method get_namespace_context

returning

value(rval) type ref to if_ixml_namespace_context.

 

 

method get_namespace_prefix

Returns the namespace prefix of this node.

interface

if_ixml_element

return value

Returns the node's namespace prefix.

abap signature

method get_namespace_prefix

returning

value(rval) type string.

 

 

method get_namespace_uri

Returns the URI of the namespace of this node.

interface

if_ixml_element

return value

Returns the node's namespace URI.

abap signature

method get_namespace_uri

returning

value(rval) type string.

 

 

method get_next

This method returns a pointer to this node's successor node.

interface

if_ixml_element

return value

Returns this node's successor node.

abap signature

method get_next

returning

value(rval) type ref to if_ixml_node.

 

 

method get_owner_document

Provides access to the Document object associated with this node. This is also the document object used to create new nodes. When the node is a document this is null.

interface

if_ixml_element

return value

Returns a pointer to this node's Document node.

abap signature

method get_owner_document

returning

value(rval) type ref to if_ixml_document.

 

 

method get_parent

Returns the parent node of this node. If no such node exists, i.e. this node is the root node, null is returned.

interface

if_ixml_element

return value

Returns the node's parent node.

abap signature

method get_parent

returning

value(rval) type ref to if_ixml_node.

 

 

method get_prev

This method returns a pointer to this node's predecessor node.

interface

if_ixml_element

return value

Returns this node's predecessor node.

abap signature

method get_prev

returning

value(rval) type ref to if_ixml_node.

 

 

method get_root

This method returns a pointer to this node's root node.

interface

if_ixml_element

return value

Returns this node's root node.

abap signature

method get_root

returning

value(rval) type ref to if_ixml_node.

 

 

method get_type

Returns the type of this node (see iXMLNode::NodeType).

interface

if_ixml_element

return value

Returns the node's type.

abap signature

method get_type

returning

value(rval) type I.

 

 

method get_value

Returns the value of this node (if such a value is defined). Not all node types have values, in which case a null string is returned.

interface

if_ixml_element

return value

Returns the node's value if one exists or a null string.

abap signature

method get_value

returning

value(rval) type string.

 

 

method has_ancestor

This method returns true, if this node has ancestor as a direct or indirect parent node.

interface

if_ixml_element

parameters

ancestor

A pointer to the ancestor to check.

return value

Returns true if this node has ancestor as a direct or indirect parent node.

abap signature

method has_ancestor

importing

ancestor type ref to if_ixml_node

returning

value(rval) type boolean.

 

 

method insert_child

This method inserts newChild immediately before the given refChild node in this node's list of children. If refChild is 0, newChild is appended to the end of the list of children.

interface

if_ixml_element

parameters

new_child

The node to insert as a child node.

ref_child

The child node to insert newChild before (may be 0)

return value

Returns one of the following return codes:

ixml_mr_dom_ok = 0

The given node has been inserted successfully.

ixml_mr_dom_invalid_arg = 0x00020003L

One or more of the given arguments are invalid.

ixml_mr_dom_not_parent_child = 0x0002000eL

The refChild argument doesn't reference a child node of this node.

abap signature

method insert_child

importing

new_child type ref to if_ixml_node

ref_child type ref to if_ixml_node

returning

value(rval) type I.

 

 

method is_leaf

This method returns true, if this node is a leaf node, i.e. a node without child nodes.

interface

if_ixml_element

return value

Returns true if this node is a leaf node.

abap signature

method is_leaf

returning

value(rval) type boolean.

 

 

method is_root

This method returns true, if this node is a root node, i.e. a node without a parent node.

interface

if_ixml_element

return value

Returns true if this node is a root node.

abap signature

method is_root

returning

value(rval) type boolean.

 

 

method num_children

This method returns the number of child nodes of the this node.

interface

if_ixml_element

return value

Returns the number of child nodes.

abap signature

method num_children

returning

value(rval) type I.

 

 

method remove_child

Removes the child node indicated by oldChild from the list of children and returns it.

interface

if_ixml_element

parameters

old_child

The child node to remove.

return value

Returns one of the following return codes:

ixml_mr_dom_ok = 0

The given node has been removed successfully.

ixml_mr_dom_invalid_arg = 0x00020003L

The given argument is invalid.

ixml_mr_dom_not_parent_child = 0x0002000eL

The oldChild argument doesn't reference a child node of this node.

abap signature

method remove_child

importing

old_child type ref to if_ixml_node

returning

value(rval) type I.

 

 

method remove_node

Removes this node (and all child nodes) from the document.

interface

if_ixml_element

abap signature

method remove_node.

 

 

method render

This method renders this node to the given output stream ostream.

interface

if_ixml_element

parameters

ostream

The output stream to render into.

recursive [ default 'X' ]

True, if this node's children are to be rendered, too.

abap signature

method render

importing

ostream type ref to if_ixml_ostream

recursive type boolean default 'X'.

 

 

method replace_child

This method replaces this node's child node oldChild with newChild.

interface

if_ixml_element

parameters

new_child

The node with which to replace oldChild.

old_child

The child node to replace.

return value

Returns one of the following return codes:

ixml_mr_dom_ok = 0

The given node has been replaced successfully.

ixml_mr_dom_invalid_arg = 0x00020003L

One or more of the given arguments are invalid.

ixml_mr_dom_not_parent_child = 0x0002000eL

The oldChild argument doesn't reference a child node of this node.

abap signature

method replace_child

importing

new_child type ref to if_ixml_node

old_child type ref to if_ixml_node

returning

value(rval) type I.

 

 

method set_name

This method sets this node's name (local part).

interface

if_ixml_element

parameters

name

The new name for this node.

return value

Returns one of the following return codes:

ixml_mr_dom_ok = 0

The name has been changed successfully.

ixml_mr_dom_not_allowed = 0x00020008L

The name of this object can't be changed.

abap signature

method set_name

importing

name type string

returning

value(rval) type I.

 

 

method set_namespace

This method sets this node's namespace (prefix).

deprecated

This method has been replaced by the method set_namespace_prefix(). It is still supported for compatibility reasons, but we recommend to switch to the replacement method, since set_namespace() may not be supported any more in a future release.

interface

if_ixml_element

parameters

namespace

The new namespace (prefix) for this node.

return value

Returns one of the following return codes:

ixml_mr_dom_ok = 0

The namespace (prefix) has been changed successfully.

ixml_mr_dom_not_allowed = 0x00020008L

The namespace (prefix) of this node can't be set.

abap signature

method set_namespace

importing

namespace type string

returning

value(rval) type I.

 

 

method set_namespace_prefix

This method sets this node's namespace prefix.

interface

if_ixml_element

parameters

prefix

The new namespace prefix for this node.

return value

Returns one of the following return codes:

ixml_mr_dom_ok = 0

The namespace prefix has been changed successfully.

ixml_mr_dom_not_allowed = 0x00020008L

The namespace prefix of this node can't be set.

abap signature

method set_namespace_prefix

importing

prefix type string

returning

value(rval) type I.

 

 

method set_namespace_uri

This method sets this node's namespace URI.

interface

if_ixml_element

parameters

prefix

The new namespace URI for this node.

return value

Returns one of the following return codes:

ixml_mr_dom_ok = 0

The namespace URI has been changed successfully.

ixml_mr_dom_not_allowed = 0x00020008L

The namespace URI of this node can't be set.

abap signature

method set_namespace_uri

importing

uri type string

returning

value(rval) type I.

 

 

method set_value

This method sets a node's value. This operation is not supported or defined on all node types.

interface

if_ixml_element

parameters

value

The value to set for this node.

return value

Returns one of the following return codes:

ixml_mr_dom_ok = 0

The value has been set successfully.

ixml_mr_dom_invalid_arg = 0x00020003L

The given argument is invalid.

ixml_mr_dom_not_allowed = 0x00020008L

This node doesn't allow to set its value.

abap signature

method set_value

importing

value type string

returning

value(rval) type I.

 

 

method query_interface

Queries the specified interface.

interface

if_ixml_element

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.