revXMLPutIntoNode |
Type | command |
Dictionary | LCS |
Library | LiveCode Script |
Syntax | revXMLPutIntoNode <treeID>, <nodePath>, <newContents> [, <replaceTextOnly>]
|
Associations | xml library |
Summary | Sets the contents of a node in an XML tree.
|
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.
|
nodePath | | The path to the node whose contents you want to set.
|
newContents | | The text that the node will contain.
|
replaceTextOnly | | The replaceTextOnly specifies whether to keep child nodes or not. If
replaceTextOnly is true then all text in the specified node is replaced
with newContents, but all child nodes are preserved. Otherwise all child
nodes are removed. The replaceTextOnly parameter is optional, and if not
given, defaults to false.
|
|
Example | revXMLPutIntoNode 12,"/Article/Author","Jane Li"
revXMLPutIntoNode myCurrentNode,dataPaths["current"],field "Data", true
|
Values | |
Related | Command: revXMLDeleteNode, revXMLAppend
Function: result, uniDecode, revXMLCreateTree, revXMLCreateTreeFromFile
Glossary: XML tree, Standalone Application Settings, tag, standalone application, Unicode, node, command, LiveCode custom library
Library: XML library
|
Security | disk |
Description | Use the revXMLPutIntoNode command to put data into a node, between
the node's start and end tags.
Tip: To put Unicode text into a node, first use the uniDecode
function to encode the text as UTF-8:
revXMLPutIntoNode the docId of field "xmltree",selectedNode,
uniDecode(the unicodeText of field "Contents" ,"UTF8")
Important: The revXMLPutIntoNode 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 |