4D v13.4

DOM SET XML ELEMENT NAME

Home

 
4D v13.4
DOM SET XML ELEMENT NAME

DOM SET XML ELEMENT NAME 


 

DOM SET XML ELEMENT NAME ( elementRef ; elementName ) 
Parameter Type   Description
elementRef  String in XML element reference
elementName  String in New name of element

The DOM SET XML ELEMENT NAME command modifies 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 also takes 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>

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.

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).

 
PROPERTIES 

Product: 4D
Theme: XML DOM
Number: 867

The OK variable is changed by the commandThis command modifies the Error system variable

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D 2004

 
SEE ALSO 

DOM GET XML ELEMENT NAME