I am trying to parse an XML file created to execute an Analytic App. My XML input file is attached. I am attempting to capture the values in the XML. eg. True in Line 3, 2 in Line 5.
I have replaced the first and last lines with blanks. I attempted to create a REGEX_Replace function in my Formula tool.
REGEX_Replace([Field_1], '(<Module.*?>|<Value.*?>)?(.*)(</Module>?|</Value>?)?', '$2')
But this formula does not capture the values while leaving out the beginning and ending tags. Any suggestions to resolve this?
My XML is as in the screenshot. The above regex formula captures the ending tags along with the values and outputs it as the result.
I resolved the problem by applying 2 Regex formulas
[XML Values]:REGEX_Replace([Field_1], '(<Module.*?>|<Value.*?>)?(.*)(</Module>|</Value>)?', '$2')
[XML Values]:Regex_Replace([XML Values], '(</Module>|</Value>)$', '')
This captures the values and then removes the ending tags which were being output earlier.