Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am using Open Studio 7.1 to compare xml files with JSONB files.
I have an xml that contains a list of entities.
Each entity has a name.
Each entity has one or several entries.
The entries don't have a name or a value, nothing to identify them.
Each entry can have one or more dataitems
Each entry can have recursive dataGroups
Each entry can have a list of descriptions, containing a number of translations
I need to compare this file with a JSON file that does represent one of my entries.
Issue 1: so far, I got to extract the descriptions with the translations of a given entry (if it does have one), with general information plus the name of the entity.
BUT I don't know how to include a number or id for the entry, so I know that the descriptions belong to entity1, entry1. Does anybody have a solution?
Issue 2: I want to check all the entries, even if they have no lsdlist, But if I put the loop at Entry level, I won't get the ldslist.
Issue 3: I have 4 loops: entry, dataitem, datagroup (recursive...) and lsdlis, and I don't know to to chain them so I know that this entry contains theses dataitems, these datagroups and these lsdlists.
Any help is welcome.
Here is the root loop I use is:
ReferenceDataRespMsg/RDEntityList/RDEntity/RDEntry/LsdList/description
Here is the metadata:
Here is the tFileInputXml:
Here is the job (only one entry had lsdList, but I cannot even tell because no way to distinguish entries):
The file I have used is in attachment.
I found the solution. The ids should be:
For entity: "count(ancestor::RDEntity/preceding-sibling::RDEntity) + 1"
For entry: "count(ancestor::RDEntry/preceding-sibling::RDEntry) + 1"
Try the Xpath index-of function.
Something like this:
entryNumber "index-of(../../RDEntry)"
I am not sure of the exact syntax.
You could also look at the position() function.
I found the solution. The ids should be:
For entity: "count(ancestor::RDEntity/preceding-sibling::RDEntity) + 1"
For entry: "count(ancestor::RDEntry/preceding-sibling::RDEntry) + 1"