Introduction to the XML object
Overview
The XML
predefined object is a wrapper based on a c++ library.
The XML
object can be used in the SCRIPT
attribute and also in the following functions, which are executed after disambiguation:
It is used to navigate a Studio project taxonomy file.
Navigate the document levels
To navigate the hierarchical structure of an XML document, the XML
object tracks the current position that defines the action context of the methods within the document.
The current position consists of:
- The parent position.
- The main position.
- The child position.
In the following XML structure you can see an example of the current position pointers.
<?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>
There is no current position when loading a document. It changes after calling the methods that move the position, for example findChildElem(xmlID, childElementName)
or findElem(xmlID, elementName)
.
XML object methods
The functionalities of the XML
object are exposed through its methods:
closeDocument(xmlID)
findChildElem(xmlID, childElementName)
findElem(xmlID, elementName)
getAttrib(xmlID, attribName)
getChildAttrib(xmlID, childAttribName)
getChildData(xmlID)
getChildTagName(xmlID)
getData(xmlID)
getTagName(xmlID)
intoElem(xmlID)
iterateChildElem(xmlID)
iterateElem(xmlID)
openDocument(xmlFile)
outOfElem(xmlID)
savePos(xmlID, posLabel) and restorePos(xmlID, posLabel)