XML Parsing

VJR

Well-Known Member
Hi

I'm trying to parse Form C XML to extract Form information.
I have tried sanitizing XML and then used 'Get elements By Xpath' action under Utility – XML business object but it's not fetching any results.

Form C XML example: https://www.sec.gov/Archives/edgar/data/1757811/000167025418000533/primary_doc.xml

Can someone please guide.
Thanks
You can check for XPath related links on this thread else you would also need to end up like one of our forum members did in post #4 for getting the values.
 

sivagelli

Well-Known Member
I'm trying to parse Form C XML to extract Form information.
I have tried sanitizing XML and then used 'Get elements By Xpath' action under Utility – XML business object but it's not fetching any results.

Form C XML example: https://www.sec.gov/Archives/edgar/data/1757811/000167025418000533/primary_doc.xml

Can someone please guide.
The xml you are trying to parse has namespace, xmlns="http://www.sec.gov/edgar/formc". So, Path: "/edgarSubmission/formData" will not work for you. Whenever you have namespace associated to xml, you either have to create a prefix and use the prefix in your query or pass the namespace in the query. So, for your problem statement, here is the input for Path:

"/*[name()='edgarSubmission']/*[name()='formData']"

OR

"/*[name()='edgarSubmission' and namespace-uri()='http://www.sec.gov/edgar/formc']/*[name()='formData' and namespace-uri()='http://www.sec.gov/edgar/formc']"

Post back how it goes.
 

sivagelli

Well-Known Member
Both the approaches would solve the problem statement.
The reference post also does not throw much light on the usage of xpath action for xml. I hope the post i shared would serve as reference for anyone looking to use xpath action for xml.

Cheers!
 
Top