You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "Wing Yew Poon (JIRA)" <xm...@xml.apache.org> on 2012/09/21 19:44:07 UTC

[jira] [Comment Edited] (XMLBEANS-490) XML tag is not created for [minOccurs="1" and nillable="false"]

    [ https://issues.apache.org/jira/browse/XMLBEANS-490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460646#comment-13460646 ] 

Wing Yew Poon edited comment on XMLBEANS-490 at 9/22/12 4:42 AM:
-----------------------------------------------------------------

Yuriy, can you please post the java code you use to produce the xml? (In other words, what did you do in your Info XMLBean?)
XMLBeans only puts in what you set. If you didn't set the Value element in your Info bean, then it is not there. XMLBeans does not guarantee that what you do is valid.

                
      was (Author: wypoon):
    Yuriy, can you please post the java code you use to produce the xml? (In other words, what did you do in your Info XMLBean?)
FYI,

<Info>
    <Name>test</Name>
    <Value/>
<Info>

is invalid according to your schema.

<Info>
    <Name>test</Name>
    <Value xsi:nil="true"/>
<Info>

is valid.
Also, XMLBeans only puts in what you set. If you didn't set the Value element in your Info bean, then it is not there. XMLBeans does not guarantee that what you do is valid.

                  
> XML tag is not created for [minOccurs="1" and nillable="false"]
> ---------------------------------------------------------------
>
>                 Key: XMLBEANS-490
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-490
>             Project: XMLBeans
>          Issue Type: Bug
>    Affects Versions:  Version 2.3
>            Reporter: Yuriy Glushanin
>
> Hello all,
> My XSD scheme:
> <xs:element name="Info">
>     <xs:complexType>
>         <xs:sequence minOccurs="1" maxOccurs="1">
>             <xs:element minOccurs="1" maxOccurs="1" name="Name" type="xs:string"/>
>             <xs:element minOccurs="1" maxOccurs="1" name="Value" type="xs:string"/>
>         </xs:sequence>
>     </xs:complexType>
> </xs:element>
> XML message when Name is "test" and Value is NULL:
> <Info>
>     <Name>test</Name>
> <Info>
> I expect empty <Value /> tag in the result:
> <Info>
>     <Name>test</Name>
>     <Value />
> <Info>
> Why empty <Value /> tag was not created?
> Best regards,
> Yuriy.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org