Given an XML structure like so:
<?xml version="1.0" encoding="UTF-8"?>
<JSON>
<allFiles>
<_-Mna81v3-W_7WC1w69n9>
<name type="string">File1</name>
<reason type="string">Issue1</reason>
<status type="string">Pending</status>
<submissionTime type="string">11/3/2021, 10:11:37 AM</submissionTime>
</_-Mna81v3-W_7WC1w69n9>
<_-Mna83OkLF8vB8fV6CIy>
<name type="string">File2</name>
<reason type="string">Other</reason>
<status type="string">Pending</status>
<submissionTime type="string">11/3/2021, 10:11:44 AM</submissionTime>
</_-Mna83OkLF8vB8fV6CIy>
</allFiles>
</JSON>
As you can see the child nodes inside allFiles are generic names, how can I target them?
I tried to return them through the following
/JSON/allFiles[1]
File1 IssuePending11/3/2021, 10:11:37 AMFile2OtherPending11/3/2021, 10:11:44 AM
/JSON/allFiles/*
returns the first child node as the following
File1 Issue1Pending11/3/2021, 10:11:37 AM
I am confused how to target the child nodes of allFiles (_-Mna81v3-W_7WC1w69n9 and _-Mna83OkLF8vB8fV6CIy) without mentioning their name in the command as they are generic and change.
/JSON/allFiles/*syntax is correct, but if it is returning the nodes in the string format you show, you'll need to provide more details about how you are invoking the XPath and what tools you are using.