on 12-10-2009 7:53 PM
Hey Guys
I created a data type in PI then made a XSD out of It ,when i try to import that in Syndicator i don't get any root element for it. but if i tweak the XSD just a little bit. it works perfectly in syndicator.
I understand MDM has some limitations in terms of XSD attributes it uses.
The XSD which is imported from PI and does not gives root element is below
<?xml version="1.0" encoding="UTF-8" ?>
- <xsd:schema xmlns="http://mc.com/MDM/CustomerMaster" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:complexType name="DT_Sender">
- <xsd:sequence>
- <xsd:element name="Name" type="xsd:string" minOccurs="0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">56635e00e5a911deaefc0012f0e979b0</xsd:appinfo>
</xsd:annotation>
</xsd:element>
- <xsd:element name="Description" type="xsd:string" minOccurs="0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">56635e01e5a911de8eac0012f0e979b0</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
XSD which works is as below
<?xml version="1.0" encoding="UTF-8" ?>
- <xsd:schema xmlns="http://millercoors.com/MDM/CustomerMaster" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:element name="DT_Sender">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="Name" type="xsd:string" minOccurs="0">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">56635e00e5a911deaefc0012f0e979b0</xsd:appinfo>
</xsd:annotation>
</xsd:element>
- <xsd:element name="Description" type="xsd:string" minOccurs="0">
- <xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">56635e01e5a911de8eac0012f0e979b0</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
The only difference between the 2 XSD's is that in the first one i have element defined as
<xsd:complexType name="DT_Sender">
whereas in the second one i have defined it as
<xsd:element name="DT_Sender">
<xsd:complexType>
Is there some kind of restriction for element definition in XSD for MDM?
Thanks
Saif
Hello Saif,
have a detailed look at your XSDs.
The first one does not define any root element. It contains the definition of a complex type only. But there is no element that is using the complex type "DT_Sender". That is the reason why Syndicator does not show any root element for selection.
The second one is different. This one defines an element "DT_Sender" that consists of a complex type. Now Syndicator is able to show the element.
If you want to use the first definition you have to add an element using the complex type. It could look like:
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns="http://mc.com/MDM/CustomerMaster" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="DT_Sender" type="DT_Sender" />
<xsd:complexType name="DT_Sender">
<xsd:sequence>
<xsd:element name="Name" type="xsd:string" minOccurs="0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">56635e00e5a911deaefc0012f0e979b0</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="Description" type="xsd:string" minOccurs="0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">56635e01e5a911de8eac0012f0e979b0</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
Some further tipps and tricks:
1) If you need the xmlns="http://mc.com/MDM/CustomerMaster" in your XML, it makes more sense to add this in the Syndication map properties. There is a field for the namespace where you should paste the http://mc.com/MDM/CustomerMaster part.
2) xmlns:xsd definitions don't have to be mentioned for each element. If you do this in the schema, it's ok.
3) MDM does not handle annotations in the XSD. You can remove them.
So a perfect XSD could look like
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="DT_Sender" type="DT_Sender" />
<xsd:complexType name="DT_Sender">
<xsd:sequence>
<xsd:element name="Name" type="xsd:string" minOccurs="0" />
<xsd:element name="Description" type="xsd:string" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
Best regards
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Saif,
Yes , Syndicator restricts the use of "ComplexType name" . Syndicator supports only the basic properties of schema.
The only properties and values which the Syndicator actually reads from a schema are:
1. name
2. minOccurs="0" or "1"
3 .maxOccurs="unbounded"
4. mixed="true"
Suggest you proceed with your second option.
Regards,
Vinay M.S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.