cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Nested Repeating Sections creating Corrupt XML

Jump to solution

I have a form with a repeating panel that has a nested repeating panel inside it where users can enter license numbers. There is specific reasoning for having the nested panels, due to the nature of the requirements. I would like to be able to take the XML output from the containing repeating section, which is saved into a multiline text field (plain text) and pull out various XML tags, using the XML Query Action. The problem is that most of the XML that is exported from the form and placed into a multiline text field is "corrupt". For some reason all of the opening and closing tags "ie <" , quotation marks, and question marks are using the equivalent ascii character, like "quot;". One work around is to pull the XML into a variable and run a replace formula or use the Regular Expression action, however I thought I would see if anyone else has run into this issue and if they know of a workaround to get "clean" XML exported from their forms.

 

Here is an example of the exported XML:

<?xml version="1.0" encoding="utf-8"?><RepeaterData><Version

/><Items><Item><PN type="System.String">9</PN><Qty

type="System.String">1</Qty><Version

type="System.String"></Version><LicenseNumbers

type="System.String">&amp;lt;?xml version=&amp;quot;1.0&amp;quot;

encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&amp;lt;RepeaterData&amp;gt;&amp;lt;Version

/&amp;gt;&amp;lt;Items&amp;gt;&amp;lt;Item&amp;

 

Also note that it is dumping in a duplicate beginning opening tag XML tag. I understand that it is doing this because it is a nested repeating section, however I can live with that for now.........

Labels: (3)
0 Kudos
Reply
4 Replies
Not applicable

Re: Nested Repeating Sections creating Corrupt XML

Jump to solution

hi Scott,

I was dealing with the same problem for the past week - I worked around it putting the corrupt chunk into another multiline-text variable (using the XML Query of the outer repeating section,) and using the Regular Expression function to replace the corrupted bits with their appropriate characters. Does that make sense?

Capture.PNG

0 Kudos
Reply
Not applicable

Re: Nested Repeating Sections creating Corrupt XML

Jump to solution

Hi, Scott Lassiter​! Did Jose's solution work or did you find one? If so, please let us know. If you're still seeking a solution, your feedback is always welcome. Thank you!

0 Kudos
Reply
Workflow Hero

Re: Nested Repeating Sections creating Corrupt XML

Jump to solution

XML is not corrupt. Outer XML contains embedded XML as value string, therefor this XML was encoded. You have to decode embedded XML string, e.g. by inline function XmlDecode.

0 Kudos
Reply
Not applicable

Re: Nested Repeating Sections creating Corrupt XML

Jump to solution

You're right, corrupt is not the right word.

The XmlDecode function is much quicker and simpler. I was doing the 'decoding' by hand with three replacements (in the Regular Expressions,) but the inline function works perfectly in a Set Variable box.

Thank you for pointing us in the right direction!

Capture2.PNGCapture3.PNG

0 Kudos
Reply