on 11-26-2008 1:12 AM
Hi! I have created a XML to load the catalog item in batch mode and I understand that I have to use a XSD. So, I got a generated copy of the XSD (using XMLSpy), added the XML schema in the MDM Console and assigned it to the appropriate Port. I then loaded the product file in the Ready folder and the file disappeared - indicating that it has been processed. An exception occurred on checking the status of the load. In the report, there is a message - Source file does not conform to XML Schema.
I then tried to import the XML through Import Manager and am able to import without problem. However, if I do the import using XSD, I found that the data did not appear at all for the structure. I reckon that may be the reason why the batch import did not work. However, I am not sure what is wrong with the XSD. Anybody has any idea? Thanks in advance for any help rendered.
Below are my XML data and XSD:
<?xml version="1.0" encoding="utf-8"?>
<ProductCatalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\TEMP\Product Load XML.xsd">
<MaterialContent>
<Category>OTHER</Category>
<MfgPartNum/>
<MfgName/>
<SupPartNum>9999TEST</SupPartNum>
<SupName>Company ABC</SupName>
<SupID>5650</SupID>
<Description>9999 TEST ITEM</Description>
<ScaleValue>1</ScaleValue>
<Price>2.0</Price>
<InfoRecord/>
<PurOrg/>
<Currency>NZD</Currency>
<UOM>EA</UOM>
<LongDescription/>
<Picture/>
<UNSPSC>44122011</UNSPSC>
<UNSPSCDesc>Folders</UNSPSCDesc>
<LeadTime>2</LeadTime>
<Aliases/>
<ProdGroup>00603</ProdGroup>
<ItemType/>
<Type/>
<MimeType/>
<URLDesc/>
<URLLink/>
</MaterialContent>
</ProductCatalog>
XSD:
<?xml version="1.0" encoding="UTF-8"?>
<!W3C Schema generated by XMLSpy v2008 rel. 2 (http://www.altova.com)>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="URLLink">
<xs:complexType/>
</xs:element>
<xs:element name="URLDesc">
<xs:complexType/>
</xs:element>
<xs:element name="UOM" type="xs:string"/>
<xs:element name="UNSPSCDesc" type="xs:string"/>
<xs:element name="UNSPSC" type="xs:int"/>
<xs:element name="Type">
<xs:complexType/>
</xs:element>
<xs:element name="SupPartNum" type="xs:string"/>
<xs:element name="SupName" type="xs:string"/>
<xs:element name="SupID" type="xs:short"/>
<xs:element name="ScaleValue" type="xs:byte"/>
<xs:element name="PurOrg">
<xs:complexType/>
</xs:element>
<xs:element name="ProductCatalog">
<xs:complexType>
<xs:sequence>
<xs:element ref="MaterialContent" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ProdGroup" type="xs:short"/>
<xs:element name="Price" type="xs:decimal"/>
<xs:element name="Picture" type="xs:string"/>
<xs:element name="MimeType">
<xs:complexType/>
</xs:element>
<xs:element name="MfgPartNum">
<xs:complexType/>
</xs:element>
<xs:element name="MfgName">
<xs:complexType/>
</xs:element>
<xs:element name="MaterialContent">
<xs:complexType>
<xs:sequence>
<xs:element ref="Category"/>
<xs:element ref="MfgPartNum"/>
<xs:element ref="MfgName"/>
<xs:element ref="SupPartNum"/>
<xs:element ref="SupName"/>
<xs:element ref="SupID"/>
<xs:element ref="Description"/>
<xs:element ref="ScaleValue"/>
<xs:element ref="Price"/>
<xs:element ref="InfoRecord"/>
<xs:element ref="PurOrg"/>
<xs:element ref="Currency"/>
<xs:element ref="UOM"/>
<xs:element ref="LongDescription"/>
<xs:element ref="Picture"/>
<xs:element ref="UNSPSC"/>
<xs:element ref="UNSPSCDesc"/>
<xs:element ref="LeadTime"/>
<xs:element ref="Aliases"/>
<xs:element ref="ProdGroup"/>
<xs:element ref="ItemType"/>
<xs:element ref="Type"/>
<xs:element ref="MimeType"/>
<xs:element ref="URLDesc"/>
<xs:element ref="URLLink"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="LongDescription">
<xs:complexType/>
</xs:element>
<xs:element name="LeadTime" type="xs:byte"/>
<xs:element name="ItemType">
<xs:complexType/>
</xs:element>
<xs:element name="InfoRecord">
<xs:complexType/>
</xs:element>
<xs:element name="Description" type="xs:string"/>
<xs:element name="Currency" type="xs:string"/>
<xs:element name="Category" type="xs:string"/>
<xs:element name="Aliases">
<xs:complexType/>
</xs:element>
</xs:schema>
Hi SF,
Firstly Try Loading your XSD is the MDM console,by removing the Namespace from the Schema file
Remove the lines and try loading the schema and then try and import using the modified schema file.
Also remember to mention XML schema instead of just XML when importing.
<!W3C Schema generated by XMLSpy v2008 rel. 2 (http://www.altova.com)>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
Also try and remove the Name space from the source XML file:
<ProductCatalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\TEMP\Product Load XML.xsd">
If its still does not work,Then have a look at what the structural exception message is trying to convey.
You can open the Import manager with the exception file using the port as input and then correct the error,once found.
any Problem with the Structure of either the incoming source file or the Schema file will cause a structural exception.
So evaluate the structure of your Source XML with the schema XSD,it must match.In accordance with the structure and order of the fields as well.
As you file is importing correctly without the schema it clearly means that the problem lies with the XSD.
Also if you are working with any standard structures like Matmas or Debmas or having XI in the landscape,you can ask XI to generate the Schema file for you and then try.
Hope It Helped
Thanks & Regards
Simona Pinto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi! I need some clarification regarding the recommendation. I am just trying to load data for the main table (product table) not the whole repository. Just like what one would do to load the supplier data, UOM ,etc. Hence, I have created the XML file for the product data and generated the XSD using XMLSpy.
In this case, why should I load into the Console? This is the part that is confusing me.
Appreciate your clarification on this.
Thanks!
SF
Hi SF,
If you are importing just the Main table data or just the lookup table data does not matter.
What matters is that you are importing the source in the XML format,and for this you will need the XML schema definition for that XML file.
Like the excel or Txt file importing you do not need the Definition file.
But when you are importing the XML file you need to supporting Schema definition to import the data.
You can have all the repository fields in the XSD but if you can map only those fields that you want. and that contain data.
Hope It Helped
Thanks & Regards
Simona Pinto
Hi SF,
In this case, why should I load into the Console? This is the part that is confusing me.
We need to load XSD into console so that MDM Import manager can understand the associated XML file to import the data. XSD files are always used before importing the XML files to that systems can understand the the XML files in that particular manner.
Hope this helps,
+ An
Hi I have finally resolved the problem! I did that by modifying the XSD into a simpler format which at least I can understand
In general, I grouped the element definitions together and then put the top element at the bottom to reference to these elements. I also changed the type of some of the elements from complex to simple. Note that I didn't have to remove the namespace here.
For those who are interested, below is the XSD I have modified from the generated XSD shown in my original posting on this problem:
<?xml version="1.0" encoding="UTF-8"?>
<!W3C Schema generated by XMLSpy v2008 rel. 2 (http://www.altova.com)>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- definition of elements -->
<xs:element name="URLLink" type="xs:string"/>
<xs:element name="URLDesc" type="xs:string"/>
<xs:element name="UOM" type="xs:string"/>
<xs:element name="UNSPSCDesc" type="xs:string"/>
<xs:element name="UNSPSC" type="xs:int"/>
<xs:element name="Type" type="xs:string"/>
<xs:element name="SupPartNum" type="xs:string"/>
<xs:element name="SupName" type="xs:string"/>
<xs:element name="SupID" type="xs:short"/>
<xs:element name="ScaleValue" type="xs:byte"/>
<xs:element name="PurOrg" type="xs:string"/>
<xs:element name="ProdGroup" type="xs:short"/>
<xs:element name="Price" type="xs:decimal"/>
<xs:element name="Picture" type="xs:string"/>
<xs:element name="MimeType" type="xs:string"/>
<xs:element name="MfgPartNum" type="xs:string"/>
<xs:element name="MfgName" type="xs:string"/>
<xs:element name="LongDescription" type="xs:string"/>
<xs:element name="LeadTime" type="xs:byte"/>
<xs:element name="ItemType" type="xs:string"/>
<xs:element name="InfoRecord" type="xs:string"/>
<xs:element name="Description" type="xs:string"/>
<xs:element name="Currency" type="xs:string"/>
<xs:element name="Category" type="xs:string"/>
<xs:element name="Aliases" type="xs:string"/>
<!-- definition of complex elements -->
<xs:element name="MaterialContent">
<xs:complexType>
<xs:sequence>
<xs:element ref="Category"/>
<xs:element ref="MfgPartNum"/>
<xs:element ref="MfgName"/>
<xs:element ref="SupPartNum"/>
<xs:element ref="SupName"/>
<xs:element ref="SupID"/>
<xs:element ref="Description"/>
<xs:element ref="ScaleValue"/>
<xs:element ref="Price"/>
<xs:element ref="InfoRecord"/>
<xs:element ref="PurOrg"/>
<xs:element ref="Currency"/>
<xs:element ref="UOM"/>
<xs:element ref="LongDescription"/>
<xs:element ref="Picture"/>
<xs:element ref="UNSPSC"/>
<xs:element ref="UNSPSCDesc"/>
<xs:element ref="LeadTime"/>
<xs:element ref="Aliases"/>
<xs:element ref="ProdGroup"/>
<xs:element ref="ItemType"/>
<xs:element ref="Type"/>
<xs:element ref="MimeType"/>
<xs:element ref="URLDesc"/>
<xs:element ref="URLLink"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ProductCatalog">
<xs:complexType>
<xs:sequence>
<xs:element ref="MaterialContent" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Edited by: SF on Dec 3, 2008 11:17 AM
User | Count |
---|---|
74 | |
26 | |
10 | |
9 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.