cancel
Showing results for 
Search instead for 
Did you mean: 

unrecognizable XML document by XI

david_ramos2
Explorer
0 Kudos

We have a document to be mapped in XML, this document has the different fields of a table that need to be read by the XI integration engine so they can be send to the target company of the message, the fact is that at the moment whenever we do a test in the repository with the XML structure that we receive from the sender company, XI just recognize that the fields DC_FORMATO, PETIPEN and PENUMCH are different fields, but it doesn’t give the values to those fields, XI understands that the values of those fields are other fields.

<?xml version="1.0" encoding="UTF-8"?>

<replyMsg>

<dse_status>OK</dse_status>

<dse_resultData>

<kColl id="outputData">

<kColl id="errores"/>

<kColl id2="avisos"/>

<iColl id="listDataPESA">

<kColl>

<field id="DC_FORMATO" value="PUM5600"/>

<field id="PETIPEN" value="1"/>

<field id="PENUMCH" value="00008573"/>

</kColl>

</iColl>

</kColl>

</dse_resultData>

</replyMsg>

In the other hand if we change the structure of the XML like the one below, XI understands properly the fields and their values.

<?xml version="1.0" encoding="ISO-8859-1"?>

<replyMsg>

<dse_status>OK</dse_status>

<dse_resultData>

<kColl id="outputData">

<kColl id="errores"/>

<kColl id2="avisos"/>

<iColl id="listDataPESA">

<kColl>

<DC_FORMATO> PUM5600</DC_FORMATO>

<PETIPEN>1</PETIPEN>

<PENUMCH>00008573</PENUMCH>

</kColl>

</iColl>

</kColl>

</dse_resultData>

</replyMsg>

Could someone tell me if you know why XI doesn’t recognize the first XML structure (even when seems to be correct) and why it recognizes the second one, and if it is possible could someone tell me if there is a configuration option inside XI to set it up in order to allow XI to recognize the first structure, that’s because the sender company has said that it is going to be a bit difficult for them to change the XML document structure from the first way to the second one.

Thanks for your help.

Accepted Solutions (0)

Answers (4)

Answers (4)

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi victoria,

i agree with raj, if you define you structure as he propose PI should recongnize the XML as you sender system send.

modify your data type as raj said

<field>0...unbounded

...<id>(atribute of field)

...<value>(atribute of field)

</field>

and your issue should be solved

Thanks

Rodrigo

Former Member
0 Kudos

Hi,

The both structures are different as in below statements

<field id="DC_FORMATO" value="PUM5600"/>

<field id="PETIPEN" value="1"/>

<field id="PENUMCH" value="00008573"/>

field is the name and its attribute is ID is DC_FORMATO or PETIPEN.

the another attribute value contains PUM5600.

SO if you copy this XML structure in Test tab of mapping and see it will creaet the structre as

field

L--->id -


>DC_FORMATO

L->value>PUM5600

But in next XML structure

<DC_FORMATO> PUM5600</DC_FORMATO>

<PETIPEN>1</PETIPEN>

<PENUMCH>00008573</PENUMCH>

DC_FORMATO or PETIPEN are fields with values

DC_FORMATO ---> PUM5600

This makes big difference either to consider the attributes or the field.

It depends on what data type structre you have mainatined in XI.

As per your info it looks to be taht you have maintained the structre for xml

<?xml version="1.0" encoding="ISO-8859-1"?>

<replyMsg>

<dse_status>OK</dse_status>

<dse_resultData>

<kColl id="outputData">

<kColl id="errores"/>

<kColl id2="avisos"/>

<iColl id="listDataPESA">

<kColl>

<DC_FORMATO> PUM5600</DC_FORMATO>

<PETIPEN>1</PETIPEN>

<PENUMCH>00008573</PENUMCH>

</kColl>

</iColl>

</kColl>

</dse_resultData>

</replyMsg>

Thus the 1st xml structre will not be accepted. To accepte it you need to change the Data Type structre.

Thanks

Swarup

david_ramos2
Explorer
0 Kudos

Thank you all for your responses, l´ll try to explain myself, the problem here is that my "origin company" (external one) sends a message to XI engine in XML. This message is;

but I dont know how sould be the way to form 3 fields with their corresponding values.

Thanks for your help to all of u.

Former Member
0 Kudos

Victoria,

You can use below approach.

Since, the inbound message structure is not exactly same as it is defined in XI, you can use 2 stage mapping; first transforming from the incoming structure to the structure you already have.

The 2nd stage mapping will be same as are using curently.

for the first stage mapping only you have to wite an UDF that will handle these 3 problem tags.

I hope you understood the approach. let me know if you need more explaination.

Regards,

AV.

justin_santhanam
Active Contributor
0 Kudos

Victoria,

>The problem comes when XI reads

<kColl>

<field id="DC_FORMATO" value="PUM5600"/>

<field id="PETIPEN" value="1"/>

<field id="PENUMCH" value="00008573"/>

</kColl>

What was the issue? Have u defined the structure in the following way?

KColl

field 0..Unbounded

id (attribute of field)

value (attribut of field)

If yes, then u need the following structure,

<kColl>

<DC_FORMATO> PUM5600</DC_FORMATO>

<PETIPEN>1</PETIPEN>

<PENUMCH>00008573</PENUMCH>

</kColl>

I believe all the three fields will always present from the source

Then u can map it like below

value -


>Copyvalue(0)------>DC_FORMATO

value -


>Copyvalue(1)------>PETIPEN

value -


>Copyvalue(2)------>PENUMCH

raj.

Former Member
0 Kudos

Good suggestion Raj...

I was about to suggest 2 stage mapping with the first using xslt mapping with this code

<xsl:template match="id">

<DC_FORMATO>

<xsl:value-of select="@value"/>

</DC_FORMATO>

</xsl:template>

Never thought that it can be handled in data type too without any complexity.

Former Member
0 Kudos

Hi

if u want to use the fields in the file that r not recognized in the XML file provided u have to define them as a attribute not as a field.

<field id="DC_FORMATO" value="PUM5600"/>

in this case the filed DC_FORMATO has one attribute id and its value is PUM5600

Thanks

Rinku

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi

check if the structure you defined has exactly the same name in upper and lower case. remenber PI is case sensitive, and a "A" or "a" makes the difference.

also check if you are waiting the namespaces, as you copy ir you arent, but maybe in your MT you have it.

copy the inbpund file form SXI_MONITOR and do a test, if nodes of XML are red the xml you get is differents you define. compare them

let me know.

Hope it helps

Edited by: Rodrigo Pertierra on Mar 3, 2008 9:15 AM