0

私は次のxsdを持っています

<xsd:complexType name="myID">
    <xsd:choice>
        <xsd:element name="testID" type="priv:testID"/>
        <xsd:sequence>
            <xsd:element name="newID" type="priv:newID"/>
            <xsd:element name="testID" type="priv:testID" minOccurs="0"/>
        </xsd:sequence>
    </xsd:choice>
</xsd:complexType>

すべてがpriv名前空間の下にあります。問題は、それがmyID組合のように見えることです。testIDまたは と を含むシーケンスである可能性がnewIDありtestIDます。wsdl2hfromでコンパイルするとgsoap、次のメッセージが表示されます。

注:<xs:choice>組み込み <xs:sequence>または<xs:group> 共用体の使用を防止します

上記のXSDは正しいですか?

4

1 に答える 1

0

一般に、XML 型myIDは、説明したとおりに宣言できます。競合は、おそらくタイプの定義と、含めなかった定義に関連して存在しpriv:testIDますpriv:testID。たとえば、スキーマ

<?xml version="1.0" encoding="utf-8"?>
<xsd:schema targetNamespace="http://www.ok-soft-gmbh.com/xml/xsd/1.0/XMLSchema.xsd"
    elementFormDefault="qualified"
    xmlns:priv="http://www.ok-soft-gmbh.com/xml/xsd/1.0/XMLSchema.xsd"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
    <xsd:simpleType name="testID">
        <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>
    <xsd:simpleType name="newID">
        <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>
    <xsd:complexType name="myID">
        <xsd:choice>
            <xsd:element name="testID" type="priv:testID"/>
            <xsd:sequence>
                <xsd:element name="newID" type="priv:newID"/>
                <xsd:element name="testID" type="priv:testID" minOccurs="0"/>
            </xsd:sequence>
        </xsd:choice>
    </xsd:complexType>
    <xsd:element name="root" type="priv:myID"/>
</xsd:schema>

正しいでしょう。したがって、エラーが存在する場合、それは投稿した部分にはありません。

于 2010-10-18T23:31:07.347 に答える