on 10-15-2014 11:27 AM
Hi Experts,
my PI is 7.11.
I want to import a XSD as external definition.
This XSD looks as below:
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema">
<complexType name="SAP_PRICELIST_TYPE">
<sequence>
<element name="ARTIKELLISTE" type="ARTIKELLISTE_TYPE"
maxOccurs="1" minOccurs="0" />
<element name="PREISLISTEN" type="PREISLISTEN_TYPE"
maxOccurs="1" minOccurs="0" />
</sequence>
<attribute name="version" type="int" use="optional" />
<attribute name="datum" type="dateTime" use="required" />
<attribute name="benutzer" type="string" use="required" />
</complexType>
<complexType name="PREISLISTEN_TYPE">
<sequence>
<element name="PREISLISTE" type="PREISLISTE_TYPE" />
</sequence>
</complexType>
<complexType name="PREISLISTE_TYPE">
<sequence>
<element name="ARTIKELPREIS" type="ARTIKELPREIS_TYPE"
maxOccurs="unbounded" minOccurs="1" />
</sequence>
<attribute name="id" use="required">
<simpleType>
<restriction base="string">
<length value="2" />
</restriction>
</simpleType>
</attribute>
<attribute name="beschreibung" type="string" use="required" />
<attribute name="ordnungsnummer" type="int" />
</complexType>
<complexType name="ARTIKEL_TYPE">
<sequence>
<element name="BEZEICHNUNG" type="TEXT_TYPE" minOccurs="1"
maxOccurs="unbounded" />
<element name="BESCHREIBUNG" type="TEXT_TYPE" maxOccurs="unbounded"
minOccurs="0" />
<element name="GESPERRT" maxOccurs="1" minOccurs="0">
<simpleType>
<restriction base="string">
<length value="1" />
<enumeration value="X" />
</restriction>
</simpleType>
</element>
<element name="GESPERRT_AB" type="date" maxOccurs="1"
minOccurs="0" />
<element name="BOM" type="BOM_TYPE" maxOccurs="1" minOccurs="0" />
</sequence>
<attribute name="artikelnummer" type="string" use="required" />
</complexType>
<complexType name="STAFFELPREIS_TYPE">
<sequence>
<element name="PREIS" type="float" maxOccurs="1" minOccurs="1" />
</sequence>
<attribute name="staffeluntergrenze" type="int" use="required" />
</complexType>
<complexType name="TEXT_TYPE">
<sequence>
<element name="INHALT" type="string" maxOccurs="1" minOccurs="1" />
</sequence>
<attribute name="sprache" use="required">
<simpleType>
<restriction base="string">
<length value="2" />
</restriction>
</simpleType>
</attribute>
</complexType>
<complexType name="ARTIKELPREIS_TYPE">
<choice>
<element name="PREIS" type="float" maxOccurs="1" minOccurs="1" />
<element name="STAFFELPREIS" type="STAFFELPREIS_TYPE"
maxOccurs="unbounded" minOccurs="1" />
</choice>
<attribute name="artikelnummer" type="string" use="required" />
<attribute name="ordnungsnummer" type="string" use="required" />
</complexType>
<complexType name="ARTIKELLISTE_TYPE">
<sequence>
<element name="ARTIKEL" type="ARTIKEL_TYPE" maxOccurs="unbounded"
minOccurs="1" />
</sequence>
</complexType>
<complexType name="BOM_ITEM_TYPE">
<sequence>
<element minOccurs="1" maxOccurs="1" name="ITEM_TYPE">
<annotation>
<documentation>Positionstyp (N=Nichtlager; L=Lager)</documentation>
</annotation>
<simpleType>
<restriction base="string">
<maxLength value="1" />
<enumeration value="N" />
<enumeration value="L" />
</restriction>
</simpleType>
</element>
<element minOccurs="1" maxOccurs="1" name="COMPONENT">
<annotation>
<documentation>Artikelnummer der Komponente</documentation>
</annotation>
<simpleType>
<restriction base="string">
<maxLength value="18" />
</restriction>
</simpleType>
</element>
<element minOccurs="1" maxOccurs="1" name="QUANTITY">
<annotation>
<documentation>Menge</documentation>
</annotation>
<simpleType>
<restriction base="string">
<maxLength value="15" />
</restriction>
</simpleType>
</element>
<element minOccurs="1" maxOccurs="1" name="UNIT_ISO">
<annotation>
<documentation>Mengeneinheit ISO (z.B. PCE oder X)</documentation>
</annotation>
<simpleType>
<restriction base="string">
<maxLength value="3" />
</restriction>
</simpleType>
</element>
</sequence>
</complexType>
<complexType name="BOM_TYPE">
<sequence>
<element name="ITEM" type="BOM_ITEM_TYPE" maxOccurs="unbounded"
minOccurs="1" />
</sequence>
</complexType>
<element name="SAP_PRICELIST" type="SAP_PRICELIST_TYPE" />
</schema>
But I get the following error during import:
Value "xsd:ARTIKELLISTE_TYPE" is not allowed for the attribute "type" of type "QName" in element "/s... |
Value "xsd:PREISLISTEN_TYPE" is not allowed for the attribute "type" of type "QName" in element "/sc... |
Value "xsd:PREISLISTE_TYPE" is not allowed for the attribute "type" of type "QName" in element "/sch... |
Value "xsd:ARTIKELPREIS_TYPE" is not allowed for the attribute "type" of type "QName" in element "/s... |
Value "xsd:TEXT_TYPE" is not allowed for the attribute "type" of type "QName" in element "/schema/co... |
Could you give me a hint? Thanks a lot! Christine |
I have tried to imprort the same file in my system but I am not getting such error message to analyze further.
I am getting below errro in my system -
Unable to convert imported document to WSDL
Reason:
Unable to recognize document as valid XSDCheck selected category
Can you pls attached xsd file.
I also dont see QName name element in the xsd file.
thanks
chirag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christine,
I edited your xsd, it contains a lot of errors . Schemas should always have a prefix e.g xmlns:xsd="http://www.w3.org/2001/XMLSchema" uses xsd prefix. Hence all the tags in the schema has to begin and/or end with xsd or xs.
The use of xsd:choice is not in line with w3c recommendation
<choice>
<xsd:element name="PREIS" type="xsd:float" maxOccurs="1" minOccurs="1" />
<xsd:element name="STAFFELPREIS" type="STAFFELPREIS_TYPE" maxOccurs="unbounded" minOccurs="1" />
</choice>
In an xsd choice, only one of the two options should appear. Might as well replace that with xsd:sequence.
Attached is the edited xsd in text format.
Regards,
Mark
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.