-1
我的下一個XML:XSD非感測錯誤。屬性「過濾器」是不允許的
<!-- language: xml -->
<Message name="Msg1" type="SIMPLE">
<Doc> message to send </Doc>
<Parameters>
<Parameter name="param1" type="byte" filter="2" mask="On">
<Fields>
<Field encode="hex">
<Values>
<Value name="INDICATOR" id="0"/>
</Values>
</Field>
</Fields>
</Parameter>
<Parameter name="param2" type="byte" filter="3" mask="On"/>
<Parameter name="param3" type="byte"/>
</Parameters>
</Message>
和我的XSD文件是這個:
<xs:element name="Message" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element ref="Doc" minOccurs="0"/>
<xs:element name="Parameters" minOccurs="0">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Parameter" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element ref="Doc" minOccurs="0"/>
<xs:element name="Fields" minOccurs="0">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Field" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element ref="Doc" minOccurs="0"/>
<xs:element name="Values" minOccurs="0">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element ref="Doc" minOccurs="0"/>
<xs:element name="Value" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>Name of the value</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="id" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>The value</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:choice>
<xs:attribute name="encode" type="xs:string" default="hex">
<xs:annotation>
<xs:documentation>encoding</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="unique_filed_name">
<xs:selector xpath="Field"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
</xs:choice>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="filter" type="xs:string"/>
<xs:attribute name="mask" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="unique_parameter_name">
<xs:selector xpath="Parameter"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
</xs:choice>
<xs:attribute name="name">
<xs:annotation>
<xs:documentation>Unique</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="type" type="MessageTypes" use="required">
<xs:annotation>
<xs:documentation>Select a valid type</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
,我得到這個錯誤沒有意義的,因爲我加了過濾器我的XSD:
元素'Parameter',屬性'filter':屬性'filter'不允許爲 。
任何人都可以幫助我解釋爲什麼我得到這個似乎很難解決的錯誤?
Downvoting,因爲當問題被(部分)回答時你沒有跟進。看起來你有提問的歷史,不承認答案。 –