Cos-nonambig in xsd:choice group 'Unique Particle Attribution'

Hello forum.
I've following XSD specification:
<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="data">
<xsd:complexType>
<xsd:choice>
<xsd:group ref="elem1" />
<xsd:group ref="elem2" />
</xsd:choice>
</xsd:complexType>
</xsd:element>
<xsd:group name="elem1">
<xsd:sequence>
<xsd:element name="order_no" type="order_no_type" />
<xsd:element name="someAttributeElem1">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="1" />
<xsd:pattern value="[^|=]*" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:group>
<xsd:group name="elem2">
<xsd:sequence>
<xsd:element name="order_no" type="order_no_type" />
<xsd:element name="someAttributeElem2" />
</xsd:sequence>
</xsd:group>
<xsd:simpleType name="order_no_type">
<xsd:restriction base="xsd:integer">
<xsd:totalDigits value="8" />
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
on
final SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
final Schema schema = factory.newSchema(xsd);
i get the following exception
org.xml.sax.SAXParseException: cos-nonambig: "":order_no and "":order_no (or elements from their substitution group) violate "Unique Particle Attribution". During validation against this schema, ambiguity would be created for those two particles.
     at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
     at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
     at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
     at com.sun.org.apache.xerces.internal.impl.xs.XSConstraints.reportSchemaError(XSConstraints.java:315)
     at com.sun.org.apache.xerces.internal.impl.xs.XSConstraints.fullSchemaChecking(XSConstraints.java:463)
     at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:530)
     at com.sun.org.apache.xerces.internal.jaxp.validation.xs.SchemaFactoryImpl.newSchema(SchemaFactoryImpl.java:206)
     at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:489)
     at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:505)
Possibly this is related to the following bug?
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4996456
So from my point of view reading the W3C Spec, in a choice the group is
distinct. So we should be able to use it like i did.
Is the an solution or workaround provided by JAVA init self or can anybody
tell me how to find an solution in an other JAVA library. I didn't work XML
validation that often, but in the past I did use some of the Apache
Frameworks. But as I can see in the error discription, Apache is already
involved.
Attention:
The original XSD is more complicatated and shared by different programms
in different Languages, C#, .Net, Navision. So, if there is no error in
the XSD which will be handled by the other frameworks less strict or
leniant, it will be complicated for to me to argue, that we have to change
the XSD so that we can handle it in Java.
TIA
Holger

Possibly this is related to the following bug?
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4996456
Actually, as I read that bug (and I haven't gone back to the XSD spec to verify), it seems to say that the behavior you want is actually not valid -- the bug is that it would accept the choice with common first element and shouldn't have.
This seems to be the sort of lookahead problem that affects most grammars: you can't differentiate between two productions without reading one or more following symbols. Parser generators usually have a way to let you say "lookahead N tokens for this next production," but I don't believe XSD has anything like that. And I can't imagine that it would, as the structure of XML would require an essentially infinite lookahead.
But as I can see in the error discription, Apache is already involved.Yeah, the Sun JDK embeds Xerces and Xalan. To my knowledge, these two have pretty much taken over the Java parsing/transform space; there were some others (such as JDom), but they have pretty much been abandoned in terms of active development.
The original XSD is more complicatated and shared by different programms
in different Languages, C#, .Net, Navision. So, if there is no error in
the XSD which will be handled by the other frameworks less strict or
leniant, it will be complicated for to me to argue, that we have to change
the XSD so that we can handle it in Java.Well, you could simply point out that this is a case of Don't Repeat Yourself: if you have multiple complexTypes that share the same elements, that those elements should be extracted out into a common containing type.
But I think, if you read the spec carefully, you'll find that such structures are not permitted by XSD.

Similar Messages

  • JAXB binding compiler error "Unique Particle Attribution"

    I'm trying to compile an xsd but get an error:
    parsing a schema...
    [ERROR] cos-nonambig: "":SomeData and WC[##any] (or elements from their substitution group) violate "Unique Particle Attribution".
    line 4 of TestCase.xsd
    Failed to parse a schema.
    I've narrowed the error down to this test case:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
     &nbsp <xs:element name="AnElement" type="AnElementType"/>
     &nbsp <xs:complexType name="AnElementType">
       &nbsp <xs:sequence>
         &nbsp <xs:element name="SomeData" type="xs:string" minOccurs="0"/>
         &nbsp <xs:any minOccurs="0"/>
       &nbsp </xs:sequence>
     &nbsp </xs:complexType>
    </xs:schema>
    If I remove the 'minOccurs' from the 'SomeData' element, it compiles fine. Any ideas on why Sun's JAXB compiler doesn't like this xsd?
    Thanks,
    Josh

    Does modifying the schema remove the error?
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="AnElement" type="AnElementType"/>
    <xs:complexType name="AnElementType">
    <xs:choice>
    <xs:any minOccurs="0"/>
    <xs:sequence>
    <xs:element name="SomeData" type="xs:string" minOccurs="1"/>
    <xs:any minOccurs="0"/>
    </xs:sequence>
    </xs:choice>
    </xs:complexType>
    </xs:schema>
    thanks,
    Deepak

  • XML Shema & Unique Particle Attribution

    Hi all,
    I am trying to create an xml schema but I face the following error:
    cos-nonambig: "":content and "":content (or elements from their substitution group) violate "Unique Particle Attribution". During validation against this schema, ambiguity would be created for those two particles. [65]
    the above error is caused by the following section of the xsd file (specifically in the xs:choice of the question element definition):
        <xs:element name="content" type="xs:anyType"/>
        <xs:element name="weight" type="xs:positiveInteger"/>
        <xs:group name="simpleQuestionItems">
            <xs:sequence>
                <xs:element ref="content"/>
                <xs:element ref="weight"/>
            </xs:sequence>
        </xs:group>
        <xs:group name="complexQuestionItems">
            <xs:sequence>
                <xs:element ref="content" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="weight" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="question" minOccurs="1" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:group>
        <xs:element name="question">
            <xs:complexType>
                <xs:choice>
                    <xs:group ref="simpleQuestionItems"/>
                    <xs:group ref="complexQuestionItems"/>
                </xs:choice>
            </xs:complexType>
        </xs:element>Do you know how can I avoid this problem while writing something similar?

    Hello,
    See i have made some changes accordingly but still there may be some problems. I dont know why you want your schema structure in circular one. (i.e. from question group you want to ref complex and again from it you are ref to question so it is giving name collision problem)
    One another think do follow to mention the namespace (target and for your xsd) whenever you do your new xsd. Generally all project xsd's belong to only one namespace( but still as per your convience you can mention multiple)
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:ab="http://www.yourcompany.com/XMLSchema/ProjectName" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.yourcompany.com/XMLSchema/ProjectName" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <!--<xs:element name="content" type="xs:anyType"/>
         <xs:element name="weight" type="xs:positiveInteger"/>-->
         <xs:group name="simpleQuestionItems">
              <xs:sequence>
                   <xs:element name="content" type="xs:anyType"/>
                   <xs:element name="weight" type="xs:positiveInteger"/>
                   <!--<xs:element ref="ab:content"/>
                   <xs:element ref="ab:weight"/>-->
              </xs:sequence>
         </xs:group>
         <xs:group name="complexQuestionItems">
              <xs:sequence>
                   <!--<xs:element ref="ab:content" minOccurs="0"/>
                   <xs:element ref="ab:weight" minOccurs="0"/>-->
                   <xs:group ref="ab:simpleQuestionItems" minOccurs="0"/>
                   <xs:element ref="ab:question" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:group>
         <xs:element name="question">
              <xs:complexType>
                   <xs:choice>
                        <xs:group ref="ab:simpleQuestionItems"/>
                        <xs:group ref="ab:complexQuestionItems"/>
                   </xs:choice>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    Regards,
    Sachin Kulkarni, Pune- India

  • Problem: bpel deployment with xsd choice

    hi!
    i have the problem that after deploying my bpel process i dont see the choice defined in my xsd. with a very simple example the choice just dont show in the bpel console. (bpel processes => initiate => xml source just shows the xml without the choice)
    i use jdeveloper 10.1.3.1.0.3984.
    does anyone know a solution for this problem?
    thanks
    my xsd:
    <?xml version="1.0" encoding="ISO-8859-15" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns="http://www.example.org"
                targetNamespace="http://www.example.org"
                elementFormDefault="qualified">
      <xsd:element name="exampleElement">
        <xsd:annotation>
          <xsd:documentation>
            A sample element
          </xsd:documentation>
        </xsd:annotation>
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="element1" type="xsd:string"/>
            <xsd:choice>
              <xsd:element name="element3" type="xsd:string"/>
              <xsd:element name="element4" type="xsd:string"/>
            </xsd:choice>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>the bpel process consists just of an assign-component.

    Is JAXB 1.0 used to generate the client code. xsd:choice is supported, but xsd:any is not supported by JAXB 1.0.

  • Problem using choice group

    I am developing a project on quiz.
    I have to show question and 4 options in one screen.also I want that the radio buttons(choice group)for the options should be selected by up down keys only.For using up down keys I have to extend canvas.if I extend canvas then how can I place my question and radio buttons?

    You can't use the ChoiceGroup on a Canvas. You'll have to make your own menu widget.
    Another option would be to display first the question on a form with a Command "Answers" and then when the Command is pressed you switch to a List (with List.IMPLICIT set as the type).
    shmoove

  • BPELProcess - Assign Activity - xsd choice element difficulties

    Hi,
    I am trying to copy values from a pipe ("|") delimited text file that has been picked - up by a file adaptor and converted into xml of form (C1,C2,C3,...,Cn). My problem arises when I need to populate an xsd:choice element with C5 & C6 as the same type. If you need more info just let me know, Please advise...
    Kind Regards,
    Warren.

    well, lets say ur looking at the 'Copy Rules' screen, my converted string delimited file is on the left and the xsd im copying to is the right+ :
    body                             body
    spiLine                           ServiceOrder
    C1 ------------------- orderType
    C2 ------------------- refrence number
    ... +choice
    +equipment
    C5 ------------------ value
    C6
    if you can make any sense of this, what I need is to create another equipment node to assign C6 too, in the xsd:choice element...

  • JAXB generation and XSD choice serious issue

    Helo,
    Im developing a webservice that uses XSD Choice structure. Unfortunately, this must to done with choice because doesnt make sense using sequences this case.
    Ill explain bug using this link:
    http://bdoughan.blogspot.com/2011/04/xml-schema-to-java-xsd-choice.html#comment-form
    this is exactly same problem as me, JAXB in jdeveloper are generating anotations wrong! I cant map the sequence choice to webservice, that is developed from WSDL...
    So, I need some help there, I really need develop this webservice using xsd:choice and cant be done in jdeveloper and dont know why.
    I tried put the anotations like this URL but when I call the service, choice element on request was null!
    thanks

    Hi, i dont know why but when I use JAXB to generate a sample XMl I got this output:
    <guiaRequest xmlns="http://www.myservices.gov.br/mensagem/integracaobancaria/guia">
    <parametrosConsultaGuia>
    <guiaNormalRequest>
    <codigoEntidade>B83C15C173633890E0330A67021B3890</codigoEntidade>
    <codigoPorte>6</codigoPorte>
    <codigoAssunto>148</codigoAssunto>
    <numeroTransacaoInternet>267472003</numeroTransacaoInternet>
    </guiaNormalRequest>
    </parametrosConsultaGuia>
    </guiaRequest>
    This is correct to my webservice, BUT, when I invoque webservice with xsd:choice I got this request (i see that on enterprise manager) :
    <message>
    <properties>
    <property name="tracking.compositeInstanceId" value="80367" />
    <property name="tracking.ecid" value="0000J1pyNtnBDC^5lVg8yZ1DtZWJ002D4z" />
    <property name="transport.http.remoteAddress" value="10.106.14.162" />
    </properties>
    <parts>
    <part name="request" >
    <ns2:guiaNormalRequest>
    <ns2:codigoEntidade>B83C15C173633890E0330A67021B3890</ns2:codigoEntidade>
    <ns2:codigoPorte>6</ns2:codigoPorte>
    <ns2:codigoAssunto>148</ns2:codigoAssunto>
    <ns2:numeroTransacaoInternet>267472003</ns2:numeroTransacaoInternet>
    </ns2:guiaNormalRequest>
    </part>
    </parts>
    </message>
    This is wrong! see the structure is not correct.

  • Wsdl code generating with xsd:choice weblogic 8.1

    I am having a problem generating client code from a wsdl using weblogic 8.1.4 iin which the schema contains xsd:choice keyword.
    I notice on a couple of forums that this may be a problem.
    Is it a problem?
    Is there a fix?
    Cheers
    Charlie

    Is JAXB 1.0 used to generate the client code. xsd:choice is supported, but xsd:any is not supported by JAXB 1.0.

  • Xsd:choice and how to download the latest service pack?

    Hello -
    When i import my XSD, the completed XSD doesn't import. Found that the xsd:choice is preventing the complete XSD to load.
    So i found that the from the Administration part of the Integration Builder the Software build has the SP-Number as 10 but when i look at the SPAM i find that latest service packs have been applied which is 0016.
    Does anyone know how and from where to download the latest service pack for my problem?
    Thanks in advance,
    Tirumal

    Hi,
    here is a list what XSD features are supported (as of SP11)
    https://websmp204.sap-ag.de/~sapdownload/011000358700000595422005D/XSDandWSDL_XI30SP11.xls
    (if this link does not work, go to service.sap.com/xi ® Media Library ® Documentation: SAP XI 3.0 (SP11) – Supported XML Schema and WSDL (EN))
    Td download the latest Support Pack, go do
    http://service.sap.com/swdc
    regards,
    Peter

  • Choice Group Problems

    aft I add the items to the choice group.. When I use isSelected(0) == true --> to delete the particular item but it will prompt me indexarrayoutofbound.. wat happen?
    else if(c == confirm  && s == purForm)
          if(cgp.isSelected(0) == true)
           confirmForm.append("1st item on the purchase list: " + 1);
          if(cgp.isSelected(1) == true)
            confirmForm.append("2nd item on the purchase list: " + cgp.getSelectedIndex());
          if(cgp.getSelectedIndex() == 2)
            cgp.delete(2);
          if(cgp.getSelectedIndex() == 3)
            cgp.delete(3);
          if(cgp.getSelectedIndex() == 4)
            cgp.delete(4);
          if(cgp.getSelectedIndex() == 5)
            cgp.delete(5);
          if(cgp.getSelectedIndex() == 6)
            cgp.delete(6);
          if(cgp.getSelectedIndex() == 7)
            cgp.delete(7);
          if(cgp.getSelectedIndex() == 8)
            cgp.delete(8);
          if(cgp.getSelectedIndex() == 9)
            cgp.delete(9);
          if(cgp.getSelectedIndex() == 10)
            cgp.delete(10);
          if(cgp.getSelectedIndex() == 11)
            cgp.delete(11);
          if(cgp.getSelectedIndex() == 12)
            cgp.delete(12);
          createConfirmForm();
          display.setCurrent(confirmForm);
        }can someone help me please... Thankz alot...

    aft I add the items to the choice group.. When I use isSelected(0) == true --> to delete the particular item but it will prompt me indexarrayoutofbound.. wat happen?
    else if(c == confirm  && s == purForm)
          if(cgp.isSelected(0) == true)
           confirmForm.append("1st item on the purchase list: " + 1);
          if(cgp.isSelected(1) == true)
            confirmForm.append("2nd item on the purchase list: " + cgp.getSelectedIndex());
          if(cgp.getSelectedIndex() == 2)
            cgp.delete(2);
          if(cgp.getSelectedIndex() == 3)
            cgp.delete(3);
          if(cgp.getSelectedIndex() == 4)
            cgp.delete(4);
          if(cgp.getSelectedIndex() == 5)
            cgp.delete(5);
          if(cgp.getSelectedIndex() == 6)
            cgp.delete(6);
          if(cgp.getSelectedIndex() == 7)
            cgp.delete(7);
          if(cgp.getSelectedIndex() == 8)
            cgp.delete(8);
          if(cgp.getSelectedIndex() == 9)
            cgp.delete(9);
          if(cgp.getSelectedIndex() == 10)
            cgp.delete(10);
          if(cgp.getSelectedIndex() == 11)
            cgp.delete(11);
          if(cgp.getSelectedIndex() == 12)
            cgp.delete(12);
          createConfirmForm();
          display.setCurrent(confirmForm);
        }can someone help me please... Thankz alot...

  • Choice group problem

    Aft i add 25 items in the choice group..
    when i need to delete them, it will give me indexarrayoutofbounds.. How can i solve it? and wat is the max. size of the choice group?

    You can't use the ChoiceGroup on a Canvas. You'll have to make your own menu widget.
    Another option would be to display first the question on a form with a Command "Answers" and then when the Command is pressed you switch to a List (with List.IMPLICIT set as the type).
    shmoove

  • Add image to choice group

    hello
    i want help regarding adding image to the choicegroup
    the list of choices to be displayed is decided dynamically
    i used following technine wich doesn't worked
    ChoiceGroup choose=new ChoiceGroup("Choose",ChoiceGroup.EXCLUSIVE);
    choice.append("hello",Image.createImage("/img.png"))

    hi
    try to use se80. search your function group on the package (development class) you use then right-click your function group choose create then select transaction...
    reward points if helpful...thanks
    regards,
    nips

  • Need help in arranging choice group and textfield on screen

    Hi friends
    i want to display choice element (along with its text) and textfield(small one) in a single row.i want many such rows.
    i tried my best to do that.but couldent get as what i wished ,textfields comes down.
    Actually i want value inside textfield and name of the choice element when i click on any choice element,I did that functionality but only alignment is problem.
    if anyone has tried or any idea about how to get this alignment please let me know.

    you can achieve this fairly easily with group policy.
    create an OU and put your remote desktop servers in that OU.
    configure both user and computer policies in a group policy and link it to that ou.
    you need to enable loopback mode - you may want it in merge or replace depending on your other policies you have. Probably replace though I would guess. this is set in the computer configuration > admin templates > system / group policy section.
    now remove the policy you have currently setup for your users on the users OU containing the rdp users. If you want you can move these users back to your main users OU.
    when your users login to the RDP server the settings in the user section of the GPO linked to the RDP Servers OU will apply.
    when the user logs in to their own computer the policies from the user OU and computer OU will apply - but not the more restrictive RDP OU.
    hope that makes sense.
    Regards,
    Denis Cooper
    MCITP EA - MCT
    Help keep the forums tidy, if this has helped please mark it as an answer
    My Blog
    LinkedIn:

  • Missing xsd:choice block in process initiate page in BPEL console

    Hello,
    I deployed a process to Application Server 10g 10.1.3.1.0. And I wanted to initiate it from BPEL console, but from whole xml that should be there, I could only see elements, and no choice block that is also in the schema. Does anyone know what might be the problem?

    Did you do a try to clear the WSDL cache? This could sometimes help.
    Are you using 10.1.3.0 or updated to 10.1.3.3 with latest patch set?
    Marc

  • How to create dependent choice group in j2me

    I wish any one could help me in solving the problem.
    I want to use choiceGroup.popup. But want to make a dependent choiceGroup.popup.
    eg.
    category , subcategory and inner subcategory .
    When i choose electronics from category then from sub category all electronic item should be seen and
    when i choose one electronic item then in inner subcategory specific item of that sub category should be shown.
    How to do that. what to use, in web we use Ajax but in j2me all devices may not support ajax. so need a helping hand to solve this problem.
    Thank you.
    Edited by: J2me_Beginner on May 22, 2009 12:05 AM

    -- Use an ItemStateListener to detect the selection.
    -- Either: deleteAll() and append(...) to replace the contents of the second ChoiceGroup
    -- Or: remove(...) the second ChoiceGroup and insert(...) a different ChoiceGroup with the appropriate choices.
    I really can't see where AJAX comes into all this.
    db
    edit Or set(...) instead of remove(...) and insert(...), but I vaguely remember that some devices have been reported to have a buggy implementation of set(...). No, I can't remember which devices but I think the problem only arose when the substituted Item was of a different size on screen, so swapping one ChoiceGroup.POPUP with another shouldn't be a problem.
    Edited by: DarrylBurke

Maybe you are looking for

  • Secure Store and Excel Services

    Greetings, I have an Excel workbook that connects to an external SQL database.  A simple stored procedure is executed and the data displayed in a sheet.  This is a simple connection and works without issue when I open the workbook in Excel itself. I

  • Sub Totals of Groups

    Hi experts, <br> <br> i have the following problem. I've already checked this forum for it and the internet but i can't find a solution. Maybe someone of you can help me or give me a hint. <br> <br> I have a printform with a table in it, i'm able to

  • Two issues discovered: 5d tether and import movie files

    Using both the Canon 5d and 5d Mk2 I had the computer hang on import. In both cases I shot several frames in rapid succession. The 5d hangs after about only 3 rapid frames, the Mk2 after about 9. I'd guess this has something to do with the buffer. Ha

  • DB12&DB13 access issue

    Hi, when user executes DB12, DB13 T-code , user is getting error "you are not authorised to execute transaction". but when he executed SU53 tcode getting report is showing object "S_ADMI_FCD" with value DBA in BI system. what could be the reason the

  • Cannot be more dissatisfi​ed with Verizon customer service!

    I used to say Verizon is great because it has a great customer service. Now, I am having a second thought. I have just bought a new phone with a new contract and since then I have been having all kinda technical issues with the phone reception and it