The following tables provide a quick reference to the ways you can modify the contents of an XML document object. The sections that follow describe in detail how to modify XML contents.
Use the following techniques to add new information to an element:
Type | Using a function | Using an assignment statement |
---|---|---|
Attribute |
StructInsert( |
|
Child element |
To append:
To insert:
|
To append:
(where newChildName must be the same as newElem.XmlName and cannot be an indexed name such as name[3]) |
Use the following techniques to delete information from an element:
Type | Using a function | Using an assignment statement |
---|---|---|
Property |
StructDelete( |
|
Attribute |
All attributes: StructDelete( A specific attribute: StructDelete( |
Not available |
Child element |
All children of an element: StructDelete( All children with a specific name: StructDelete( A specific child:
|
Not available |
Use the following techniques to change the contents of an element:
Type | Using a function | Using an assignment statement |
---|---|---|
Property |
StructUpdate( |
|
Attribute |
StructUpdate( |
|
Child element (replace) |
(use the same value for both index entries to change one element) |
Replace first or only child named elementName:
Replace a specific child named elementName:
or
|