Skip to main content
Question

Get node by Id XML

  • March 7, 2023
  • 3 replies
  • 260 views

Forum|alt.badge.img+6

Hello friends,

I need to get several fields from an XML based on the id=voucher, how can I do it? I need this to work for N types of XML that can be structured like this:

invoice or
authorization/voucher/invoice

All XML have invoice with has id=voucher (<invoice id="voucher" version="1.1.0">) but may or may not have roots as shown above. How could I do it?

Format 1

 

Format 2

For example, I need to get razonSocial node

3 replies

Padmakumar
Premier Pathfinder | Tier 7
Forum|alt.badge.img+15
  • Premier Pathfinder | Tier 7
  • March 8, 2023

Hi @Midna08 ,

 

If you want to get a single node, you can follow the below by using the XML: Get single node action. Specify the same in the Xpath Expression.

//InfoTribtaria/razonSocial 

 

If you need to loop through multiple nodes, you may refer the below Tutorial.

 

 


Forum|alt.badge.img+6
  • Author
  • Navigator | Tier 3
  • March 8, 2023

Hi @Midna08 ,

 

If you want to get a single node, you can follow the below by using the XML: Get single node action. Specify the same in the Xpath Expression.

//InfoTribtaria/razonSocial 

 

If you need to loop through multiple nodes, you may refer the below Tutorial.

 

 

Thank you, I’m did that but I have this error:

 

 


Padmakumar
Premier Pathfinder | Tier 7
Forum|alt.badge.img+15
  • Premier Pathfinder | Tier 7
  • March 10, 2023

Hi @Midna08 ,

 

If you want to get a single node, you can follow the below by using the XML: Get single node action. Specify the same in the Xpath Expression.

//InfoTribtaria/razonSocial 

 

If you need to loop through multiple nodes, you may refer the below Tutorial.

 

 

Thank you, I’m did that but I have this error:

 

 

 

 

I am getting the output with the same. Below is FYI.