Name: revXMLParent

Type: function

Syntax: revXMLParent(<treeID>, <childNode>)

Summary:
<return|Returns> the path to the <parent node> of a <node> in an 
<XML tree>. 

Associations: xml library

Introduced: 2.0

OS: mac, windows, linux, ios, android

Platforms: desktop, server, mobile

Security: disk

Example:
revXMLParent(1,"/City/Publisher")

Example:
put revXMLParent(thisTree,thisNode) into field "Parent"

Parameters:
treeID:
The number returned by the <revXMLCreateTree> or <revXMLCreateTreeFromFile>
function when you created the <XML tree>.

childNode:
The path to the node where you want to start.

Returns:
The <revXMLParent> <function> returns a string consisting of the path to
the parent node of the <childNode>. If the <childNode> is the root node
of the <XML tree> (and therefore has no parent), the <revXMLParent>
<function> returns empty.

Description:
Use the <revXMLParent> <function> to go up one level in an <XML tree>.

If the <revXMLParent> <function> encounters an error, it
<return|returns> an error message starting with "xmlerr".

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

References: function (control structure), revXMLRootNode (function),
revXMLFirstChild (function), revXMLCreateTree (function),
revXMLCreateTreeFromFile (function), LiveCode custom library (glossary),
node (glossary), Standalone Application Settings (glossary),
standalone application (glossary), return (glossary), XML tree (glossary),
parent node (glossary), XML library (library)

Tags: text processing

