[英]XML validation seem to overlook some XSD elements
我正在嘗試從XSD構建有效負載,但顯然缺少某些內容。 這是XSD:
<xs:element name="InsuranceProducer" type="InsuranceProducer"/>
<xs:complexType name="InsuranceProducer">
<xs:sequence>
<xs:element name="distributionAgency" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>DGIS
For the exclusive agent network, the distribution agency is the same than the agency code.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="distributionNetwork" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>ExclusiveAgency</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="distributor" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>Domain of value:
DGIG
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="type" type="xs:string" minOccurs="1" maxOccurs="1">
<xs:annotation>
<xs:documentation>Agency, Agent, HoldingCode, Brokerage</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="code" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="primaryProducer" type="InsuranceProducer" minOccurs="0" maxOccurs="1"/>
<xs:element name="PartyInfo" type="partySum:PartyInfo" minOccurs="0" maxOccurs="1"/>
<xs:element name="salesPointDescription" type="xs:string" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="salesPointCode" type="xs:string" minOccurs="1" maxOccurs="1">
<xs:annotation>
<xs:documentation>Identifies the point of sale responsible for the production of insurance agreements.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="SubProducer" type="SubProducer" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:element name="SubProducer" type="SubProducer"/>
<xs:complexType name="SubProducer">
<xs:sequence>
<xs:element name="code" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="PartyInfo" type="partySum:PartyInfo" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
這是有效載荷的InsuranceProducer部分:
<InsuranceProducer xmlns="">
<distributionAgency>Something</distributionAgency>
<distributionNetwork>Something</distributionNetwork>
<distributor>Something</distributor>
<type>Something</type>
<code>Something</code>
<salesPointDescription>something</salesPointDescription>
<salesPointCode>Something</salesPointCode>
</InsuranceProducer>
但是,我收到的所有信息都是:org.xml.sax.SAXParseException:cvc-complex-type.2.4.a:發現了以元素“ salesPointDescription”開頭的無效內容。 預期為“ {primaryProducer,PartyInfo,SubProducer}”之一。,行:3,列:391
格式很好,問題實際上是在我的JBOSS上運行的發布者使用了那些字段的舊XSD shema。 我剛剛上傳了他們,瞧!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.