We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

XML Input Data Dynamic Input Fail due to different schema across different XML files

zzy98y
8 - Asteroid

Hi, 

 

I have a series of XML file and there are certain element I need to parse out. 

 

The problem with that is those element in some file it only appear once, and in some file it could appear more than once.  And when I use dynamic input try to extract it the Designer give me the error saying file have different schema. 

 

So here is an example, let's the say the element I am trying to extract are as follows: 

 

<Tag1> 

      <Tag2> 222  </Tag2> 

      <Tag3> 333  </Tag3> 

      <Tag4> 444  </Tag4>

</Tag1> 

 

I need all the elements in side tag1, and tag1 in different file could be either appear only once or more than once, but the data inside the tag1 are all the same structure. 

 

Therefore I thought if I just configure the child XML element to Tag1, Dynamic Input would be smart enough to extract all those elements for me.  

 

But unfortunately, it does not, it give me the schema error, I think it require the XML file need to be exactly the same structure, and it cannot be in slightly different structure though the element I am trying to extract are the same. 

 

I am wondering is there a work around I can use to be able extract the data using Dynamic Input. 

 

Also, I am looking for ways in which I can dynamically parse in the child XML element name with similar pattern searching, like XML child name starts with "ABC" 

 

i am not sure whether I should suggest this as a new feature for the next designer release. 

 

Any help here is appreciated! 

1 REPLY 1
KGT
13 - Pulsar

You could suggest it... but not sure if XML Parsing is high on the list. It does not hurt to throw the idea up there and if XML work is being done, it could be swept up in it. Make sure the use case is clear though as I'm not sure exactly what the idea is. Matching Child Elements in XML is a mission on a complete match, if you are suggesting partial matches, that puts a lot more Onus on the Structure.

 

In this situation, I would just bring it in as a text file (Bring in Filename as well), Combine the rows (Summarise > Concatenate (\n)), then using REGEX pull out everything between <Tag1>(.*?)</Tag1> split to a new row.

 

AlteryxGui_dduUX8YjJD.png

 

Labels
Top Solution Authors