revXMLSetAttribute |
Type | command |
Dictionary | LCS |
Library | LiveCode Script |
Syntax | revXMLSetAttribute <treeID>, <node>, <attributeName>, <newValue>
|
Associations | xml library |
Summary | Creates an attribute of a node, or sets the value of an existing
attribute.
|
Introduced | 2.0 |
OS | mac, windows, linux, ios, android |
Platforms | desktop, server, mobile |
Parameters | Name | Type | Description |
---|
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 | |
Related | Command: revXMLAppend
Function: revXMLAttributes, result, uniDecode
Glossary: Unicode, node, Standalone Application Settings, standalone application, attribute, command, LiveCode custom library
Library: XML library
|
Security | disk |
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.
|
Tags | text processing |