cancel
Showing results for 
Search instead for 
Did you mean: 

How to parse thus XML data?

Former Member
0 Kudos

Hi,experts:

In below thread:

i asked how to create a external definition in IR base on above XML data.

Now,i have created a XSD file base on the XML data.And importing it into IR successfully.

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

<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">

<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:Locale="zh-CN">

<xs:complexType>

<xs:choice maxOccurs="unbounded">

<xs:element name="Status">

<xs:complexType>

<xs:attribute name="Result" type="xs:string"/>

</xs:complexType>

</xs:element>

</xs:choice>

</xs:complexType>

</xs:element>

</xs:schema>

And now,the question is how to parse the XML data in diffgr:diffgram segment.It seems a MS-XML syntax.Can it be parsed by XI?

I tried,but the following error occurs:

com.sap.aii.utilxi.misc.api.BaseRuntimeException: RuntimeException in Message-Mapping transformation: Cannot produce target element /ns0:ZMT_SD_ORDER01_RESULT. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd at com.sap.aii.mappingtool.tf3.AMappingProgram.start

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

I am sorry to my mistake ,the thread in the topic should be :

not

you can see the whole XML data in the right thread.

how to parse the XML data in diffgr:diffgram segment?

If it is not possible, i have to ask the receiver to return the XML data base on JAVA format instead of .Net format

Former Member
0 Kudos

Hi,

The above Exception seems to be because of mapping error.

Check your mapping for all the mandatory 1-1 mapping, also the 1-unbounded parent node mapping.

Once when you import the XSD and activate your External Definition if it does without any error then there is no problem with your External Definition.

If this error occurs only when you test your mapping then this is mapping error and not because of XSD.

Please check the parent node mapping like 1-unbounded.

Reward Points if useful

Regards

Ashmi.

Former Member
0 Kudos

Hi,

com.sap.aii.utilxi.misc.api.BaseRuntimeException: RuntimeException in Message-Mapping transformation: Cannot produce target element /ns0:ZMT_SD_ORDER01_RESULT. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd at com.sap.aii.mappingtool.tf3.AMappingProgram.start

This is mapping error

plz check u mapped mandatory element or not whose occurance is 1..1.

Regards,

Rohit

Reward points if helpful.

vijay_b4
Active Contributor
0 Kudos

Hi Ming,

Did you add trace and debug your message mapping???

Goto moni copy the payload xml and paste it under test tab and set the trace to get the exacy position where its failing, may be we can get some clear idea.....

Reward points if this helps

Regards

Pragathi.

Former Member
0 Kudos

Hi,

I think there is an error in ur mapping.. Check the mapping once again..

Check the links for xml parsing:

/people/bhavesh.kantilal/blog/2006/11/20/webservice-calls-from-a-user-defined-function

/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer

Reward points if helpful..

Regards,

Soumya

GabrielSagaya
Active Contributor
0 Kudos

The error could be because of the XSD attributes.

In the Source message, check the XSD attributes of the DataType Result in the IR.

For example, it may have a pattern or whiteSpace or some other attribute.

Then check the input file contents for the NewDataSet node. One of those values may not match these attributes