cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in the XSD generation

Former Member
0 Kudos

Hi people,

In our project we are working a POC to integrate MDM. For it, the MDM people request the XSD that generated XI.

We send this XSD:

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

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

<xsd:complexType name="NombreDT">

<xsd:sequence>

<xsd:element name="campo1" type="xsd:string"></xsd:element>

<xsd:element name="campo2" type="xsd:string"></xsd:element>

<xsd:element name="campo3" type="xsd:string"></xsd:element>

<xsd:element name="campo4" type="xsd:string"></xsd:element>

<xsd:element name="campo5" type="xsd:string"></xsd:element>

<xsd:element name="campo6" type="xsd:string"></xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

The XML that we sent through scenario created in XI is:

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

<NombreDT>

<campo1>data1</campo1>

<campo2>data2</campo2>

<campo3>data3</campo3>

<campo4>data4</campo4>

<campo5>data5</campo5>

<campo6>data6</campo6>

</NombreDT>

When MDM wants to import the XML to MDM's repository using the XSD as Schema, it shows the following error:

Logon Error: Failed to Parse XML file.

Error:

COM error: 80004005 Unspecified error

Source = Description =

SAX2Error: errCode=80004005, PublicId =,

Error Message= The element "NombreDT" is used but not declared in DTD/Schema.

They have provided us a XSD and a XML that works to them correctly:

XSD:

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

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

<xs:element name="DataSuper">

<xs:complexType>

<xs:sequence>

<xs:element ref="MiniData" minOccurs="0" maxOccurs="unbounded"/>

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="MiniData">

<xs:complexType>

<xs:attribute name="code1" use="required" type="xs:integer"/>

<xs:attribute name="code2" use="required" type="xs:NCName"/>

<xs:attribute name="code3" use="required" type="xs:NMTOKEN"/>

<xs:attribute name="code4" use="required" type="xs:NMTOKEN"/>

<xs:attribute name="code5" use="required" type="xs:NCName"/>

</xs:complexType>

</xs:element>

</xs:schema>

XML:

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

<DataSuper>

<MiniData code1="22550" code2="ppp" code3="150" code4="30" code5="dat1"/>

<MiniData code1="22551" code2="out" code3="400" code4="30" code5="dat2"/>

<MiniData code1="22552" code2="out" code3="350" code4="30" code5="dat3"/>

<MiniData code1="22553" code2="ppp" code3="1505" code4="30" code5="dat1"/>

</DataSuper>

Is it the problem of the XSD generated in XI?

What is the difference between xsd:element and xs:element?

Can we generate in XI a XSD of the type xs:element?

King Regards

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I think the problem is, that the xsd you posted contains only a type definition but no element definition. I would recommend trying:

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

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

<xsd:complexType name="NombreDT">

<xsd:sequence>

<xsd:element name="campo1" type="xsd:string"></xsd:element>

<xsd:element name="campo2" type="xsd:string"></xsd:element>

<xsd:element name="campo3" type="xsd:string"></xsd:element>

<xsd:element name="campo4" type="xsd:string"></xsd:element>

<xsd:element name="campo5" type="xsd:string"></xsd:element>

<xsd:element name="campo6" type="xsd:string"></xsd:element>

</xsd:sequence>

</xsd:complexType>

<xsd:element name="NombreDT" type="NombreDT" />

</xsd:schema>

The reason why the original xsd you got from the Message TYpe contained this import statement is, that you decided to spread the definition of your Message Type over two namespaces. I assume that you changed the content of the field XML namespace in the Message Type to BLANK (by default it equals the technical namespace you define your Message Type in, in your case probably "myNamespace").

Greetings

Stephan

Former Member
0 Kudos

Hi Stephan,

It isn't correct. The Message Type and Data Type belong to the same namespace. It was the XSD that generated XI. In the Message Type, in field XML namespace, it appears the namespace to which corresponds, “myNamespace”, like Data Type.

So that working correctly we have had to edit the XSD.

Regards

Former Member
0 Kudos

Hi,

this sounds strange to me. The field XML namespace does not even exist for Data Types.

Note that for Message Types as for Data Types we have a 'Namespace'-field in the header area (between Name and Software Component Version). This field is not editable in both cases.

For Message Types (and not for Data Types) there is yet another field: 'XML Namespace' which is editable.

The XSD you have posted is exactly what would be produced, if you have this field empty. If this field contains the same string as the other 'Namespace'-field the XSD will look different.

Greetings

Stephan

Former Member
0 Kudos

Hi,

The "Xs:" and "XSD:" are just prefixes to the namespace that is defined in the top node of the XSD file....

As long as the prefix on top and on the individual element match..it can be any string...

i have not worked on MDM, however, let me ask you a question..when you import the XSD from XI into MDM...do you have an option of what type of document it is / how you want to interpret it ? the reason i am asking is because the error message you posted says - "DTD/Schema"....you are using an XSD and not a DTD....please check this...

Theoretically if you have an XSD that complies with the WS-I.org's basic profile....it should be imported into XI correctly...

Thanks.

Former Member
0 Kudos

Hi Deepu

We are using a XSD. In MDM they specify that it is a Schema (XSD). MDM needs a XSD not a DTD.

MDM needs the XSD of the Messaga Type, but the problem is that XI in the Message Type create the following XSD:


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

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="my_namespace">
	<xsd:import namespace="my_namespace" />
	<xsd:element name="my_Message_Type" type="my_Message_Type" />
</xsd:schema>

It is solved editing that XSD and to replace the line:

<xsd:import namespace="my_namespace" />

by the XSD of Data Type.

Thanks