[ http://issues.apache.org/jira/browse/JAXME-84?page=all ]

Jochen Wiedmann resolved JAXME-84.
----------------------------------

    Resolution: Fixed

The problem turned out to be, in fact, in the XS layer.

If an extended element has empty content, then the resulting content is 
actually the content of the extension element. However, when lifting this 
content up, the "minOccurs" and "maxOccurs" properties haven't been passed on.


> minOccurs="0" not recognized in choice, if the choice is within an extension
> ----------------------------------------------------------------------------
>
>                 Key: JAXME-84
>                 URL: http://issues.apache.org/jira/browse/JAXME-84
>             Project: JaxMe
>          Issue Type: Bug
>    Affects Versions: 0.5
>            Reporter: Jochen Wiedmann
>         Assigned To: Jochen Wiedmann
>
> 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']

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to