[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    [jira] Closed: (XMLBEANS-220) XmlObject.xmlText(XmlOptions) outputs
From:       "Wing Yew Poon (JIRA)" <xmlbeans-dev () xml ! apache ! org>
Date:       2009-10-26 19:00:59
Message-ID: 1470098199.1256583659539.JavaMail.jira () brutus
[Download RAW message or body]


     [ https://issues.apache.org/jira/browse/XMLBEANS-220?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel \
]

Wing Yew Poon closed XMLBEANS-220.
----------------------------------

    Resolution: Cannot Reproduce

Based on the comment thread, this does not appear to be a bug, probably user error.

> XmlObject.xmlText(XmlOptions) outputs xsi:nil="true" where schema definition is \
>                 minOccurs="0" and default value for nillable="false"
> ------------------------------------------------------------------------------------------------------------------------------------
>  
> Key: XMLBEANS-220
> URL: https://issues.apache.org/jira/browse/XMLBEANS-220
> Project: XMLBeans
> Issue Type: Bug
> Components: XmlObject
> Affects Versions: Version 2
> Environment: Windows XP, JDK 1.4.2_05
> Reporter: James Webster
> 
> We have defined a type in the schema as...
> <xsd:complexType name="MyType">
> <xsd:element name="mandatoryElement" type="xsd:string"/>
> <xsd:element name="optionalElement" minOccurs="0" type="xsd:string"/>
> </xsd:complexType>
> According to the XML Schema specification, false is the default value for the \
> optional 'nillable' attribute on xsd:element. So the 'optionalElement' element is \
> nillable='false'. We instantiate an instance of the MyType class, set the mandatory \
> element and get the value of xmlText()... MyType type = \
> MyType.Factory.newInstance(); type.setMandatoryElement("someValue");
> String xmlText = type.xmlText();
> The value of xmlText generated by XMLBeans v2.0 is...
> <MyType>
> <mandatoryElement>someValue</mandatoryElement>
> <optionalElement xsi:nil="true"/>
> </MyType>
> BUT, we would expect (given that optionalElement is NOT nillable) to see the \
> following... <MyType>
> <mandatoryElement>someValue</mandatoryElement>
> </MyType>
> Our investigations into the XMLBeans API suggests that it is not possible (via \
> XmlOptions, etc) to suppress the xsi: attributes, so we believe this may be a bug? \
> We are at no point explicitly setting the optionalElement to null.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic