DOM SET XML ELEMENT NAME

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 2004


DOM SET XML ELEMENT NAME (elementRef; elementName)

ParameterTypeDescription
elementRefStringXML element reference
elementNameStringNew name of element

Description

The DOM SET XML ELEMENT NAME command allows you to modify the name of the element set by elementRef.

Pass the reference of the element to rename in elementRef and the new name of the element in elementName. The command will also take charge of updating the open and close tags of the element.

Example

In the following XML source:

<Book>
   <Title>The Best Seller</Title>
</Book>

If the following code is executed, with vElemRef containing the reference to the 'Book' element:

   DOM SET XML ELEMENT NAME(vElemRef;"BestSeller")

We get:

<BestSeller>
   <Title>The Best Seller</Title>
</BestSeller>

See Also

DOM GET XML ELEMENT NAME.

System Variables or Sets

If the command was executed correctly, the system variable OK is set to 1. Otherwise, it is set to 0 and an error is generated.

Error Handling

An error is generated when:

The element reference is invalid

The new name of the element to create is invalid (for example, if it starts with a number).


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next