繁体   English   中英

XML验证似乎忽略了一些XSD元素

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM