cancel
Showing results for 
Search instead for 
Did you mean: 

xml and xsd ......!!!!!!

Former Member
0 Kudos

We have the following xml and xsd code . We wonder if something is missing . This .xsd has to correspond with this .xml .

When we try to import data , with Import Manager, it fails ?

Can someone take a look and let us know if any parameter is missing (name space , type .......)

Please let us know .

Many Thanks

Regards Stanley

================================================

XML CODE

==========================================

<GetBPFromAME4J xmlns='http://www.poc_ame4S.es/MDM' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><BusinessPartner xmlns=''><BPID>5</BPID><BPName>Nombre5</BPName><BPSurname>Apellidos5</BPSurname><BPCity>Ciudad5</BPCity><BPContry>Pais5</BPContry></BusinessPartner><BusinessPartner xmlns=''><BPID>6</BPID><BPName>Nombre6</BPName><BPSurname>Apellidos6</BPSurname><BPCity>Ciudad6</BPCity><BPContry>Pais6</BPContry></BusinessPartner><BusinessPartner xmlns=''><BPID>7</BPID><BPName>Nombre7</BPName><BPSurname>Apellidos7</BPSurname><BPCity>Ciudad7</BPCity><BPContry>Pais7</BPContry></BusinessPartner></GetBPFromAME4J>

====================================================

===================================================

XSD CODE

=======================================

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

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">

<xsd:complexType name="DT_GetBPFromAME4J">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">c9dcf910c71e11db930e000c29de88f9</xsd:appinfo>

</xsd:annotation>

<xsd:sequence>

<xsd:element name="BusinessPartner" minOccurs="0" maxOccurs="unbounded">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">54f756a0794d11db8d21e2e3ac12c5ab</xsd:appinfo>

</xsd:annotation>

<xsd:complexType>

<xsd:sequence>

<xsd:element name="BPID">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">a6934b10795a11db8298cad7ac12c5ab</xsd:appinfo>

</xsd:annotation>

<xsd:simpleType>

<xsd:restriction base="xsd:string">

<xsd:maxLength value="50" />

</xsd:restriction>

</xsd:simpleType>

</xsd:element>

<xsd:element name="BPName">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">a6934b11795a11dbb7fdcad7ac12c5ab</xsd:appinfo>

</xsd:annotation>

<xsd:simpleType>

<xsd:restriction base="xsd:string">

<xsd:maxLength value="50" />

</xsd:restriction>

</xsd:simpleType>

</xsd:element>

<xsd:element name="BPSurname">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">a6934b12795a11dbba13cad7ac12c5ab</xsd:appinfo>

</xsd:annotation>

<xsd:simpleType>

<xsd:restriction base="xsd:string">

<xsd:maxLength value="50" />

</xsd:restriction>

</xsd:simpleType>

</xsd:element>

<xsd:element name="BPCity">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">a6934b13795a11db87ddcad7ac12c5ab</xsd:appinfo>

</xsd:annotation>

<xsd:simpleType>

<xsd:restriction base="xsd:string">

<xsd:maxLength value="50" />

</xsd:restriction>

</xsd:simpleType>

</xsd:element>

<xsd:element name="BPContry">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">a6934b14795a11db8632cad7ac12c5ab</xsd:appinfo>

</xsd:annotation>

<xsd:simpleType>

<xsd:restriction base="xsd:string">

<xsd:maxLength value="50" />

</xsd:restriction>

</xsd:simpleType>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

<xsd:element name="GetBPFromAME4J" type="DT_GetBPFromAME4J" />

</xsd:schema>

===========================================================

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Please check if you have defined the namespace in the URI field of the XML Schema in MDM Console.

Secondly, check if the XSD is well formed using editors like XML Spy.

Then check if the XML you are tyring to import is well formed.

Also validate if the XML file conforms to the XSD using XML Spy.

Then use the Import Manager, and specify XML Schema as the input method.

Choose the above XML file which was validated using the XML Spy.

If the Parsing was successful, Import Manager would open with the records in XML file in the Source Preview.

Former Member
0 Kudos

I ran into this too when I generated my XSD in MS Visual Studio. I was able to edit the header in the XSD and get it to work. I applied my same header edit to your XSD file to your file. Try this with your existing XML file....

=======================================

XSD CODE

=======================================

<?xml version="1.0"?>

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

<xs:element name="GetBPFromAME4J" msdata:IsDataSet="true" msdata:EnforceConstraints="False">

<xs:complexType>

<xs:choice maxOccurs="unbounded">

<xs:element name="BusinessPartner" form="unqualified">

<xs:complexType>

<xs:sequence>

<xs:element name="BPID" form="unqualified" type="xs:string" minOccurs="0" />

<xs:element name="BPName" form="unqualified" type="xs:string" minOccurs="0" />

<xs:element name="BPSurname" form="unqualified" type="xs:string" minOccurs="0" />

<xs:element name="BPCity" form="unqualified" type="xs:string" minOccurs="0" />

<xs:element name="BPContry" form="unqualified" type="xs:string" minOccurs="0" />

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:choice>

</xs:complexType>

</xs:element>

</xs:schema>

Former Member
0 Kudos

Hi Andrew

Thanks for your reply .

I defined your .xsd as SCHEMA and I got the following :

1) I have tried to import the following .xml file and it works ok .

-

2) When I copy paste the same .xml file and I have tried to import it with its copy (I mean the two .xml files ), it doesn´t work . The error is :

Logon error:Failed to Parse XML file

COM error 80004005 unspecified error

Error message :the element "Business Partner" is used but not declared in the DTD schema.

What do you think ?

Many Thanks

Former Member
0 Kudos

Sorry andrew..

Disregard this message ..It seems that it works..

I will check you later because I am trying to test something.

Regards

Former Member
0 Kudos

Hi Andrew

I have tested the .xsd .

Normally it works but when I try to enter a word with the letter "ñ" , it doesn´t work .

I don´t know why ?Could you please tell me something about it ?

michael_theis
Active Contributor
0 Kudos

Hi Stanley,

could you please tell me what fails exactly? The import process? The loading of the XML? Is there any error message?

A bit strange is that you define a namespace for your root tag "xmlns='http://www.poc_ame4S.es/MDM'" but you delete / redefine it for each business partner tag "<BusinessPartner xmlns=''>". Why are you doing this?

In addition, did you define the namespace for the root tag in the Console?

Kind regards

Michael

Former Member
0 Kudos

Hi Michael

Excuse me , because I was not able to answer you yesterday..

Regarding your reply ..

1)The error is : "The element Business Partner is used but not declare in the DTD/SCHEMA"

2)The failure occurs when I try to import the xml file .

3) Please explain me how I have to do to define the root tag in the console

Many Thanks for all

michael_theis
Active Contributor
0 Kudos

Hi Stanley,

If you use a custom namespace in your XSD (e.g. the one in your XSD is xmlns='http://www.poc_ame4S.es/M'), you should define the "http://www.poc_ame4S.es/M" as URI for your XSD. You can do this in the console:

- run console and select your repository

- select Admin -> XML Schemas in the tree menu

- select your XSD file. You'll see the XSD name, the path to the file and a third input field called URI.

- enter your custom Namespace as URI

Then retest the import.

Kind regards

Michael