In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Parsing XML

busybee
7 - Meteor

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? 

4 REPLIES 4
Qiu
21 - Polaris
21 - Polaris

@busybee 
Can you kindly check if your XML is intact?

Specially Line 4, 5 and 6.

Qiu_1-1604969701872.png

 

 

busybee
7 - Meteor

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. 

randreag
11 - Bolide

hi @busybee 

 

 

I'm not sure if this is what you want to accomplish but perhaps helps

 

 

busybee
7 - Meteor

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. 

Labels
Top Solution Authors