131
Views
3
Comments
Solved
[XML Records] Create Structure with this XML Format
xml-records
Service icon
Forge asset by Afonso Carvalho
Application Type
Service

I have XML having this kind of format.

<BH> is Header of <BL> List  but is not inside of the tag.
<BL> is a List

XML Format:

Converting it to Structure literally will look like this:

But I need dynamic BH & BL nodes



Thanks.

OWN_AP_ACKNOWLEDGMENT_FILE.xml
2019-06-15 21-39-22
Afonso Carvalho
 
MVP
Solution

Hello Marco,

If there are "interfering" tags between your lists of tags (BL between your list of BH), then I don't think there's an easy way to do this. XML Records requires your XML to be predictable so that values can be mapped to the Structure that you defined. If the order of elements inside could completely change within a tag then it would be extremely complex to fill out a Structure.

Do you control the provider of this XML, or can you influence its format in any way? I think the best solution would be to make sure the XML tags are either:

 - ordered (a list of BH followed by a list of BL): this would make it so you can use lists inside your Structure safely and make it fully dynamic;

 - grouped: I don't know if the tags that you shared are semantically related (BH belongs to BL or vice-versa), so if they were grouped in a parent tag like this:

<Parent>

<BH>

<ListOfBL>

</Parent>

<AnotherParent>

...

</AnotherParent>

this would make it possible to create a fully dynamic Structure with Lists.

2020-04-13 12-15-05
Marco Sacay

Yes. you're right about how the XML format should be. but unfortunately, i have no control over it. thanks for the confirmation.

2024-04-08 10-59-50
Pedro Sismeiro

May I ask you how did you solve this?

I'm facing the exact same problem.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.