LitDev Extension API

GW LD3DView LDArray LDBits LDBlueTooth
LDCall LDChart LDClient LDClipboard LDColours
LDCommPort LDController LDControls LDCursors LDDataBase
LDDateTime LDDebug LDDialogs LDDictionary LDEffect
LDEmail LDEncryption LDEvents LDFastArray LDFastShapes
LDFigures LDFile LDFinances LDFocus LDftp
LDGeography LDGraph LDGraphicsWindow LDHashTable LDHID
LDIcon LDImage LDInline LDIOWarrior LDList
LDLogic LDMath LDMathX LDMatrix LDMusic
LDNetwork LDPhysics LDProcess LDQueue LDRegex
LDResources LDScrollBars LDSearch LDServer LDSettings
LDShapes LDShell LDSort LDSound LDSpeech
LDStatistics LDStopwatch LDText LDTextWindow LDTimer
LDTranslate LDUnits LDUtilities LDVector LDWaveForm
LDWebCam LDWindows LDxml LDZip TW

LDxml
xml file parsing methods.

AddNode Attributes AttributesCount
ChildrenCount FirstChild FirstNode
FromArray LastChild NextSibling
NodeInnerText NodeName NodeType
Open Parent PreviousSibling
RemoveNode RenameRoot Save
Switch ToArray View

AddNode(name,attributes,text,location)
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
Get an array of attribute text values indexed by attribute name or "" on failure.

AttributesCount
Get the number of attributes of the current node.

ChildrenCount
Get the number of children of the current node.

FirstChild()
Move the current node to the first child node if there is one.
returns "SUCCESS" or "FAILED".

FirstNode()
Set the current node to the first document node.
returns "SUCCESS" or "FAILED".

FromArray(array)
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()
Move the current node to the last child node if there is one.
returns "SUCCESS" or "FAILED".

NextSibling()
Move the current node to the next sibling node if there is one.
returns "SUCCESS" or "FAILED".

NodeInnerText
Get the inner text of the current node and all children or "" on failure.

NodeName
Get the name of the current node or "" on failure.

NodeType
Get the type of the current node.
May be one of many types, but commonly "Element" or "Text".


Open(fileName)
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()
Move the current node to the parent node if there is one.
returns "SUCCESS" or "FAILED".

PreviousSibling()
Move the current node to the previous sibling node if there is one.
returns "SUCCESS" or "FAILED".

RemoveNode()
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)
Rename the root element (default is "root").
name The name of the root element.
returns "SUCCESS" or "FAILED".

Save(fileName)
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)
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()
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()
View XML for dubugging purposes.
returns None.