intoElem(xmlID)
The intoElem(xmlID)
method moves from the current main position element into the current child position so that become the "new" current parent position element.
In other words, intoElem(xmlID)
makes the main position element the parent element.
If there isn't a main position, it returns false and doesn't affect the current position.
Note
This method is used to go into a deeper level in the document, while outOfElem(xmlID)
is used to go up the level.
For example, considering the following XML document:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DOMAINTREE> <-- Parent position
<DOMAIN NAME="1" LABEL="one"> <-- Main position
<DOMAIN NAME="1.1" LABEL="one.one"> <-- Child position
<DOMAIN NAME="1.1.1" LABEL="one.one.one"/>
<DOMAIN NAME="1.1.2" LABEL="one.one.two"/>
</DOMAIN>
</DOMAIN>
<DOMAIN NAME="2" LABEL="two"/>
<DOMAIN NAME="3" LABEL="three"/>
</DOMAINTREE>
If:
- The main position is located on the
DOMAIN
element and has the attributes:NAME
= 1LABEL
= one
- The parent position is located on the
DOMAINTREE
element. - The child position is located on the
DOMAIN
element that has the attributes:NAME
= 1.1LABEL
= one.one
The following instruction:
XML.intoElem(xmlID);
moves the positions as follows:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DOMAINTREE>
<DOMAIN NAME="1" LABEL="one"> <-- Parent position
<DOMAIN NAME="1.1" LABEL="one.one"> <-- Main position
<DOMAIN NAME="1.1.1" LABEL="one.one.one"/> <-- Child position
<DOMAIN NAME="1.1.2" LABEL="one.one.two"/>
</DOMAIN>
</DOMAIN>
<DOMAIN NAME="2" LABEL="two"/>
<DOMAIN NAME="3" LABEL="three"/>
</DOMAINTREE>
The syntax is:
XML.intoElem(xmlID)
where xmlID
is the ID of the XML document.