Uploaded image for project: 'JaxMe'
  1. JaxMe
  2. JAXME-84

minOccurs="0" not recognized in choice, if the choice is within an extension

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.5
    • None
    • None
    • None

    Description

      Using the following schema

      <xs:schema
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      targetNamespace="http://namespaces.softwareag.com/de/s/xDWS/soap-api"
      xmlns:xdws="http://namespaces.softwareag.com/de/s/xDWS/soap-api"
      elementFormDefault="qualified"
      attributeFormDefault="unqualified">
      <xs:complexType name="xdwsResultInfo">
      <xs:attribute name="rc" type="xs:int" use="required"/>
      <xs:attribute name="message" type="xs:string" use="optional"/>
      <xs:attribute name="details" type="xs:string" use="optional"/>
      </xs:complexType>
      <xs:element name="xdwsResponse">
      <xs:complexType>
      <xs:sequence>
      <xs:element name="response" minOccurs="0" maxOccurs="unbounded">
      <xs:complexType>
      <xs:complexContent>
      <xs:extension base="xdws:xdwsResultInfo">
      <xs:choice minOccurs="0">
      <xs:element name="a" type="xs:string"/>
      <xs:element name="b" type="xs:string"/>
      </xs:choice>
      </xs:extension>
      </xs:complexContent>
      </xs:complexType>
      </xs:element>
      <xs:element name="result" type="xdws:xdwsResultInfo"/>
      </xs:sequence>
      <xs:attribute name="version" type="xs:int" use="required" />
      </xs:complexType>
      </xs:element>
      </xs:schema>

      and the following test

      /** Test for <a href="http://issues.apache.org/jira/browse/JAXME-84">JAXME-84</a>.
      */
      public void testJAXME84() throws JAXBException

      { final String xml = "<xdwsResponse xmlns='http://namespaces.softwareag.com/de/s/xDWS/soap-api' version='1'>\n" + "<response rc='4'/>\n" + "<result rc='4'/>\n" + "</xdwsResponse>\n"; unmarshalMarshalUnmarshal(XdwsResponse.class, xml); }

      causes an error Unexpected end element: '

      {http://namespaces.softwareag.com/de/s/xDWS/soap-api}

      response']

      Attachments

        Activity

          People

            jochen@apache.org Jochen Wiedmann
            jochen@apache.org Jochen Wiedmann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: