LitDev Extension API
LDxml
![](images/IntellisenseObject.png)
xml file parsing methods.
AddNode(name,attributes,text,location)
![](images/IntellisenseMethod.png)
Add a new node.
The current node is unchanged, it is not updated to be the new node.
name The new node element name.
attributes An array of attributes (values indexed by attribute name) for the new node or "".
text Inner text for the new node or "".
location Where the node is inserted.
"Append" - insert at the end of current node's child nodes.
"Prepend" - insert at the start of current node's child nodes.
"Before" - insert before the current node.
"After" - insert after the current node.
returns "SUCCESS" or "FAILED".
Attributes
![](images/IntellisenseProperty.png)
Get an array of attribute text values indexed by attribute name or "" on failure.
AttributesCount
![](images/IntellisenseProperty.png)
Get the number of attributes of the current node.
ChildrenCount
![](images/IntellisenseProperty.png)
Get the number of children of the current node.
FirstChild()
![](images/IntellisenseMethod.png)
Move the current node to the first child node if there is one.
returns "SUCCESS" or "FAILED".
FirstNode()
![](images/IntellisenseMethod.png)
Set the current node to the first document node.
returns "SUCCESS" or "FAILED".
FromArray(array)
![](images/IntellisenseMethod.png)
Performs the inverse function of ToArray method, create an xml document from an array definition.
array A Small Basic array with the correct format.
returns A name for the document or "FAILED".
LastChild()
![](images/IntellisenseMethod.png)
Move the current node to the last child node if there is one.
returns "SUCCESS" or "FAILED".
NextSibling()
![](images/IntellisenseMethod.png)
Move the current node to the next sibling node if there is one.
returns "SUCCESS" or "FAILED".
NodeInnerText
![](images/IntellisenseProperty.png)
Get the inner text of the current node and all children or "" on failure.
NodeName
![](images/IntellisenseProperty.png)
Get the name of the current node or "" on failure.
NodeType
![](images/IntellisenseProperty.png)
Get the type of the current node.
May be one of many types, but commonly "Element" or "Text".
Open(fileName)
![](images/IntellisenseMethod.png)
Open an existing xml file. This must be called before any other methods can be used.
fileName The full path to the xml file to open.
If this is "", then a new empty xml document is created.
returns A name for the document or "FAILED".
Parent()
![](images/IntellisenseMethod.png)
Move the current node to the parent node if there is one.
returns "SUCCESS" or "FAILED".
PreviousSibling()
![](images/IntellisenseMethod.png)
Move the current node to the previous sibling node if there is one.
returns "SUCCESS" or "FAILED".
RemoveNode()
![](images/IntellisenseMethod.png)
Remove the current node and all child nodes.
The current node is reset to the previous sibling or parent node if no previous sibling exists.
returns The new current node "SIBLING", "PARENT" or "FAILED".
RenameRoot(name)
![](images/IntellisenseMethod.png)
Rename the root element (default is "root").
name The name of the root element.
returns "SUCCESS" or "FAILED".
Save(fileName)
![](images/IntellisenseMethod.png)
Save the current xml document to a file.
fileName The full path to the file to write the xml.
returns "SUCCESS" or "FAILED".
Switch(docName)
![](images/IntellisenseMethod.png)
Switch to another open xml document. The current node for all documents are preserved.
docName The name returned by Open method.
returns "SUCCESS" or "FAILED".
ToArray()
![](images/IntellisenseMethod.png)
Convert the current xml document to a Small Basic array.
The structure and depth of the array may be quite complex.
Each node has optional arrays "Attributes", and "Children" or "Data".
If there are are child nodes then they are indexed first by number to deliminate multiple children with the same name.
returns A Small Basic array or "FAILED".
View()
![](images/IntellisenseMethod.png)
View XML for dubugging purposes.
returns None.