Hi people,
I have requirement where i need to find the X path of an XML file. We have functions to retrieve a value using the X path. But our requirement is retrieve the X path instead of the value, So that the user will use that and cross verify the xml file whether its matching. Here is an example.
Input:
<Document> <customer> <details> <name>xyz</name> <address>abc</address> <contact> <phone>45667778</phone> <employee> <company> <department> <id>6786</id> </department> </company> </employee> </contact></details>
</customer></Document>
Output:
for Retrieving the name XYZ this would be the X path
"<Document><customer><details><name>" this is actual output we require
And this is the output we need for nested X path.
"<Document><customer><details> <contact><employee><company><department><id>"
Discussion posts and replies are publicly visible
The whole idea of xPath is, no know the path where to look for data beforehand. If you do not know the structure of the XML, I do not know of any easy way to somehow find specific nodes, values, or paths in it.
Is there any built-in function or third party plug-in which might be of any help in this case.The structure of the XML is dynamic in nature, hence the issue.
docs.appian.com/.../fnc_scripting_xpathsnippet.html