Name: revXMLParent

Type: function

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

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

Introduced: 2.0

OS: mac,windows,linux,ios,android

Platforms: desktop,server,web,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 <Revolution custom library|custom library> when you create your <standalone application|standalone>. In the Inclusions section on the General screen of the <Standalone Application Settings> window, make sure "XML Library" is selected in the list of script libraries.

References: function (control_st), revXMLRootNode (function), revXMLFirstChild (function), XML library (library), Revolution custom library (library), node (glossary), Standalone Application Settings (glossary), standalone application (glossary), return (glossary), XML tree (glossary), parent node (glossary)

Tags: text processing
