none
Schema Validation Error RRS feed

  • Question

  • <xs:complexType name="InvoiceDetailOrderInfo">
        <xs:sequence>
          <xs:choice minOccurs="0">
            <xs:sequence>
              <xs:element minOccurs="0" name="OrderReference">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" name="DocumentReference" type="DocumentReference" />
                  </xs:sequence>
                  <xs:attribute name="orderID" type="xs:string" use="optional" />
                  <xs:attribute name="orderDate" type="xs:dateTime" use="optional" />
                </xs:complexType>
              </xs:element>
              <xs:choice minOccurs="0">
                <xs:group minOccurs="0" ref="MasterAgreementReference" />
                <xs:group minOccurs="0" ref="MasterAgreementIDInfo" />
              </xs:choice>
              <xs:group minOccurs="0" ref="SupplierOrderInfo" />
            </xs:sequence>
            <xs:sequence>
              <xs:group ref="MasterAgreementReference" />
              <xs:group minOccurs="0" ref="OrderIDInfo" />
              <xs:group minOccurs="0" ref="SupplierOrderInfo" />
            </xs:sequence>
            <xs:sequence>
              <xs:group ref="MasterAgreementIDInfo" />
              <xs:group minOccurs="0" ref="OrderIDInfo" />
              <xs:group minOccurs="0" ref="SupplierOrderInfo" />
            </xs:sequence>
            <xs:sequence>
              <xs:group ref="OrderIDInfo" />
              <xs:group minOccurs="0" ref="SupplierOrderInfo" />
            </xs:sequence>
            <xs:group ref="SupplierOrderInfo" />
          </xs:choice>
        </xs:sequence>
      </xs:complexType>

    When i validate the schema i get the following error::

    • Cos-nonambig: MasterAgreementReference And MasterAgreementReference (or Elements From Their Substitution Group) Violate "Unique Particle Attribution". During Validation Against This Schema, Ambiguity Would Be Created For Those Two Particles.

    Please help ...

    Thursday, February 5, 2015 5:56 AM

Answers

  • Hi Akhil,

    It’s really tough to find the cause with just part/subset of  schema shared here.

    According to W3C XML Schema version 1.0 : "Unique Particle Attribution" is rule/ mechanism to prevent ambiguity.

    Since the error says “MasterAgreementReference And MasterAgreementReference (or Elements From Their Substitution Group) Violate "Unique Particle Attribution", the element MasterAgreementReference should be associated with the element declaration (xsd:element name="MasterAgreementReference"), or the wildcard (xsd:any), which I believe/assume is not in your case. I can only assume this as you have not shared the complete schema.

    Check wheather MasterAgreementReference is declared as element or in xsd:any

    Reference: http://en.wikipedia.org/wiki/Unique_Particle_Attribution


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    • Marked as answer by AKNLearner Tuesday, September 1, 2015 12:22 PM
    Thursday, February 5, 2015 12:10 PM
  • When I created a XSD from what you have given, the schema validation was successful.


    I have uploaded the schema here, you can download it.

    Backup your schema, delete your copy, use the one which I am sending. May be you have some reference which is creating the issue. Try this copy.

    https://onedrive.live.com/redir?resid=AC2383A73FFE27CE!2614&authkey=!AHzRBmtUgGLzCac&ithint=file%2cxsd


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.


    Friday, February 6, 2015 10:39 AM

All replies

  • Hi,

    Try by adding the maxOccurs="*" property to any of the MasterAgreementReference sequnce like below and try..

    <xs:group minOccurs="0" ref="MasterAgreementReference" maxOccurs="1" />


    Regards - Rajasekhar.R ' Don't forget to mark the post as answer or vote as helpful if it does,

    Thursday, February 5, 2015 6:31 AM
  • Hi Akhil,

    It’s really tough to find the cause with just part/subset of  schema shared here.

    According to W3C XML Schema version 1.0 : "Unique Particle Attribution" is rule/ mechanism to prevent ambiguity.

    Since the error says “MasterAgreementReference And MasterAgreementReference (or Elements From Their Substitution Group) Violate "Unique Particle Attribution", the element MasterAgreementReference should be associated with the element declaration (xsd:element name="MasterAgreementReference"), or the wildcard (xsd:any), which I believe/assume is not in your case. I can only assume this as you have not shared the complete schema.

    Check wheather MasterAgreementReference is declared as element or in xsd:any

    Reference: http://en.wikipedia.org/wiki/Unique_Particle_Attribution


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    • Marked as answer by AKNLearner Tuesday, September 1, 2015 12:22 PM
    Thursday, February 5, 2015 12:10 PM
  • When I created a XSD from what you have given, the schema validation was successful.


    I have uploaded the schema here, you can download it.

    Backup your schema, delete your copy, use the one which I am sending. May be you have some reference which is creating the issue. Try this copy.

    https://onedrive.live.com/redir?resid=AC2383A73FFE27CE!2614&authkey=!AHzRBmtUgGLzCac&ithint=file%2cxsd


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.


    Friday, February 6, 2015 10:39 AM
  • Hi,

    I am trying to validate the schema through a validator tool online

    http://www.utilities-online.info/xsdvalidation/#.VNIrS2iUd4k

    Please validate the schema in this mentioned tool

    

    Friday, February 6, 2015 11:27 AM