DOM SET XML ATTRIBUTE

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 ATTRIBUTE (elementRef; attrName; attrValue{; attrName2; attrValue2; ...; attrNameN; attrValueN})

ParameterTypeDescription
elementRefStringXML element reference
attrNameStringAttribute to set
attrValueStringNew attribute value

Description

The DOM SET XML ATTRIBUTE command allows adding one or more attributes to the XML element whose reference is passed in the elementRef parameter. It also allows setting the value of each attribute defined.

Pass the attriibute to set and its value respectively in the attrName and attrValue parameters (in the form of variables, fields or literal values). You can pass as many attribute/value pairs as you want.

Example

In the following XML source:

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

If the following code is executed:

   vAttrName:="Font"
   vAttrVal:="Verdana"
   DOM SET XML ATTRIBUTE(vElemRef;vAttrName;vAttrVal) 

We get:

<Book>
   <Title Font=Verdana>The Best Seller</Title>
</Book>

See Also

DOM GET XML ATTRIBUTE BY INDEX, DOM GET XML ATTRIBUTE BY NAME.

System Variables or Sets

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


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