![]() |
Previous Top Next |
Using XMLData
|
1. | Access to the names and values of all kinds of elements (e.g. elements, attributes)
|
|
2. | Creation of new elements of all kinds.
|
|
3. | Insertion and appending of new elements.
|
|
4. | Erasing of existing child elements.
|
|
|
1. Create the new XMLData object:
|
Use the "XMLSpyDocumentEditor.CreateChild" method to create a new XMLData object. Set name and value after you have inserted the new XML entity (see point 3).
|
|
2. Find the correct location for the new XMLData object:
|
To insert a new XMLData object you have to get a reference to the parent first. If the new child is to become the last child of the parent, use the "XMLData.AppendChild" method to insert the XMLData object.
|
If the new child should be located elsewhere in the sequence of child objects, use the "XMLData.GetFirstChild" and "XMLData.GetNextChild" to move the iterator to the child before which the new child should be inserted.
|
|
3. Insert the new child with "XMLData.InsertChild"
|
The new child will be inserted immediately before the current child.
|
|
The following example adds a third child between <FirstChild> and the <SecondChild> element:
|
|