revXMLSetAttribute

Typecommand
DictionaryLCS
LibraryLiveCode Script
Syntax
revXMLSetAttribute <treeID>, <node>, <attributeName>, <newValue>
Associationsxml library
Summary

Creates an attribute of a node, or sets the value of an existing attribute.

Introduced2.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
treeID

The number returned by the revXMLCreateTree or revXMLCreateTreeFromFile function when you created the XML tree.

node

The path to the node whose attribute will be set.

attributeName
newValue
Example
revXMLSetAttribute 6,"/Vegetable/Tree/Cedar","height","tall"
revXMLSetAttribute thisTree,currNode,myString,field "Data"
Values
NameTypeDescription
The result

If the revXMLSetAttribute command encounters an error, the result is set to an error message beginning with "xmlerr".

RelatedCommand: revXMLAppend
Function: revXMLAttributes, result, uniDecode
Glossary: Unicode, node, Standalone Application Settings, standalone application, attribute, command, LiveCode custom library
Library: XML library
Securitydisk
Description

Use the revXMLSetAttribute command to create and change attributes.

If the attributeName is not already an attribute of the node, a new attribute with the specified name and value is created.

If the attribute already exists, its value is set to the newValue.

Tip: To put Unicode text into an attribute, first use the uniDecode function to encode the text as UTF-8:

revXMLSetAttribute myTree,the nodeName of me, \
      uniDecode(the unicodeText of it,"UTF8")

Important: The revXMLSetAttribute command is part of the XML library. To ensure that the command works in a standalone application, you must include this custom library when you create your standalone. In the Inclusions pane of the Standalone Application Settings window, make sure the "XML" checkbox is checked.

Tagstext processing