revXMLNodeContents

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
revXMLNodeContents(<treeID>, <node>)
Associationsxml library
Summary

Returns the text contained in the specified node in an XML tree.

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 contents you want to get.

Example
revXMLNodeContents(3,"/Book/Chapter/Section")
put revXMLNodeContents(thisDoc,mySection) into field "Current Section"
Values
NameTypeDescription
return

The revXMLNodeContents function returns a string.

RelatedKeyword: string
Glossary: node, Standalone Application Settings, standalone application, XML tree, return, LiveCode custom library
Command: revXMLDeleteNode, revXMLAppend
Function: revXMLAttribute, revXMLCreateTree, revXMLCreateTreeFromFile
Library: XML library
Control Structure: function
Securitydisk
Description

Use the revXMLNodeContents function to get the text contents of a node.

If the revXMLNodeContents function encounters an error, it returns an error message starting with "xmlerr".

The revXMLNodeContents function returns the text content of a node. This is defined as the first piece of text not contained within a child node. For example:

<root>Text<child>Child Text</child>Text 2</root>

In the preceeding XML document, revXMLNodeContents will return the string "Text" when called with "root" as the node.

Important: The revXMLNodeContents function is part of the XML library. To ensure that the function 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