Skip to Content
0
Former Member
Dec 04, 2006 at 12:53 PM

Mapping Issue - Context Changes

38 Views

Hello all. I am working on a file - file scenario, XML - XML. My messages look as follows:

<u><b>Source:</b></u>

-<header> (1..unbounded)

---<field1>test</field1> (1..unbounded)

---<field2>test2</field2> (1..unbounded)

---<field3>1,2,3,4</field3> (1..unbounded)

-</header>

<u><b>Target:</b></u>

-<header> (1..unbounded)

---<field1>test</field1> (1..1)

---<field2>test2</field2> (1..1)

---<fieldTree> (1..unbounded)

-


<subField1>1</subField1> (1..1)

---</fieldTree>

---<fieldTree>

-


<subField1>2</subField1>

---</fieldTree>

---<fieldTree>

-


<subField1>3</subField1>

---</fieldTree>

---<fieldTree>

-


<subField1>4</subField1>

---</fieldTree>

-</header>

I have a UDF that creates the fieldTree contexts based on the number of items in field3 of source deliminated by comma. Another UDF to split the values and place into the subField positions.

That works fine, however when there are multiple entries of the source message, similar to:

<header>

<field1>test</field1>

<field2>test2</field2>

<field3>1,2,3,4</field3>

</header>

<header>

<field1>test3</field1>

<field2>test4</field2>

<field3>5,6,7,8</field3>

</header>

I receive this error:

<i>Cannot produce target element /ns0:test_XML/header[2]/fieldTree. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd</i>

If I disable the fieldTree field in target message it works fine. The mapping looks like this:

<u>target / source</u>

header / header

field1 / field1

field2 / field2

fieldTree / (UDF) field3

subField1 / (UDF) field3

My guess is it's something very simple that I am overlooking. Or some way that XI handles this sort of thing that I do not understand that could possibly be throwing errors at me. Anyone have any ideas to point me in the right direction?