IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Question on XML to DB with multiple levels of nesting Options · View
BenRhew
Posted: Monday, July 30, 2018 9:58:21 PM
Rank: Newbie

Joined: 7/30/2018
Posts: 2
Hello all,

I am trying to take an XML document and store it in several database tables - basically document ingestion. I am having a bit of a problem, however, as my documents have 2 levels of nesting - the main document has sub-documents, and those sub-documents can in turn have an array of values as one of the fields, essentially another sub-document. When testing the mapping to output to database tables, the main document and the first sub-document all behave correctly, except for the array of values fields. I get warnings on those - "One or several additional values were skipped." I have tried several different methods to get this to work and have not been successful, including variables, filters, and other mappings. The mapping I am trying to work with looks like this (this is simplified to the bare bones of the problem), and references a couple of tables. Any ideas or help would be appreciated!


BenRhew attached the following image(s):
mapping.png

island
Posted: Tuesday, July 31, 2018 11:18:10 AM
Rank: Newbie

Joined: 10/28/2002
Posts: 1,283
Location: AT
Hi,

why this is occuring is best illustrated by example.

In the top example of the mapping below "foo" (which appears once in the source file) is connected to "Rows", meaning that one Row will be generated in the output. The problem is that there are three "barvalue" elements. It is not possible to store all three values in one row so the last "barvalue" i.e. "bar3" will be stored in "Field2".

In the bottom example "barvalue" (which occurs three times in the source) is connected to "Rows"meaning that three Rows will be generated. This will accomodate all three "barvalue" elements and the "foovalue" will be repeated for each row.



island attached the following image(s):
map.png

BenRhew
Posted: Tuesday, July 31, 2018 11:22:27 AM
Rank: Newbie

Joined: 7/30/2018
Posts: 2
Aha, thank you for that! That was the one thing I didn't try - now I can move on with the rest of my mapping.
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.