Hi. I have 30 or 40 xml tables I must read from a supplier. I can read most of them. But several of them have some repeated child elements which I can't seem to read.
e.g. in below the <RestaurantAreas> has multiple child <RestaurantAreaCodeId> elements, and I only seem to be able to read the first in the list. Can anyone please help me?
I have attached my test (TestXmlRecords.oml) that I'm using.
Hello Alan,
You're only receiving the first value of the XML element list because in the Structure, RestaurantAreaCodeId is defined as a Text value and not as an actual List.
I've attached an .oml of a Structure that is able to contain your XML example - note how the Brands and RestaurantAreas Structures are defined, it's the same idea in both cases. It's not outputting to the Screen, but you should be able to confirm the results while debugging the Preparation of WebScreen1:
Let me know if you need any further assistance.
Thank you for your response, and the working example.
I had tried 3 different options, including the one you gave, but they weren't working for me.
In my working solution I had several files all with the BRAND group inside, and so I had renamed them Brand1, Brand2, Brand3, and this must have been preventing the read.
I had to copy the data structures to a separate module (so there were no name clashes) with the other XML files I was reading, and then it started working correctly.
An interesting lesson to learn when you have lots of XML files to read!
Thanks again.
The translation from XML to Structures is a little awkward, especially when you have more complex documents to process.
Glad to hear you got it working, good luck.