You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Sorin Slavescu <ss...@OriginalSolutions.ie> on 2005/08/05 18:34:07 UTC

Nill elements

Hi people, 

I just started using XmlBeans, migrating from JAXB by the way, and I have a problem with null elements. What I need to know is how can I make so that the elements that are null, and specified nillable in my xsd, are not written in the file at all. At the moment it is writing the element with xsi:nil="true" attribute.

Thanks for help.


**********************************************************************************
Privileged, confidential and/or copyright information may be contained in this e-mail. This e-mail is for the use only of the intended addressee. If you are not the intended addressee, or the person responsible for delivering it to the intended addressee, you may not copy, forward, disclose or otherwise use it or any part of it in any way whatsoever. To do so is prohibited and may be unlawful.

If you receive this e-mail by mistake please advise the sender immediately by using the reply facility in your e-mail software.

Original Solutions Ltd. may monitor the content of e-mails sent and received via its network for the purposes of ensuring compliance with its policies and procedures.

This message is subject to and does not create or vary any contractual relationship between Original Solutions and you.
**********************************************************************************



Re: Nill elements

Posted by Mark Lewis <ma...@mir3.com>.
Specifying elements as nillable in the xsd means that you include them
with xsi:nil='"true".  So you're getting what you asked for.

If you don't want the value to be included at all, just specify
minOccurs="0" in the xsd, and don't set a value for it at all.

-- Mark

On Fri, 2005-08-05 at 17:34 +0100, Sorin Slavescu wrote:
> Hi people, 
> 
> I just started using XmlBeans, migrating from JAXB by the way, and I
> have a problem with null elements. What I need to know is how can I
> make so that the elements that are null, and specified nillable in my
> xsd, are not written in the file at all. At the moment it is writing
> the element with xsi:nil="true" attribute.
> 
> Thanks for help.
> 
> 
>                                    
> ______________________________________________________________________
> 
> Privileged, confidential and/or copyright information may be contained
> in this e-mail. This e-mail is for the use only of the intended
> addressee. If you are not the intended addressee, or the person
> responsible for delivering it to the intended addressee, you may not
> copy, forward, disclose or otherwise use it or any part of it in any
> way whatsoever. To do so is prohibited and may be unlawful.
> 
>  
> 
> If you receive this e-mail by mistake please advise the sender
> immediately by using the reply facility in your e-mail software.
> 
>  
> 
> Original Solutions Ltd. may monitor the content of e-mails sent and
> received via its network for the purposes of ensuring compliance with
> its policies and procedures.
> 
>  
> 
> This message is subject to and does not create or vary any contractual
> relationship between Original Solutions and you.
> 
>                                    
> ______________________________________________________________________


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


NullPointerException when compiling with static handler feature

Posted by Scott Hinkelman <sr...@us.ibm.com>.
Hi,
I am getting a NullPointerException when trying to use the handler
extension feature in V2.
Using the 2 pass process per the wiki, I am sure the interface and the
handler are on the class path, however I get the same problem
with or without the classpath having them. Any help?

xsdconfig snip:
 <xb:extension
for="com.ibm.xml.namespaces.industry.medical.medbiquitous.professionalprofile.xmlbeans.MembersType">
        <xb:interface name="com.ibm.industryobjects.IndustryObject">

<xb:staticHandler>com.ibm.industryobjects.IndustryObjectStaticHandler</xb:staticHandler>
        </xb:interface>
</xb:extension>

Loading schema file member.xsd
Loading config file .\memberconfig.xsdconfig
Exception in thread "main" java.lang.NullPointerException
        at
org.apache.xmlbeans.impl.schema.StscState.get(StscState.java:1213)
        at
org.apache.xmlbeans.impl.config.BindingConfigImpl.error(BindingConfigImpl.java:289)
        at
org.apache.xmlbeans.impl.config.InterfaceExtensionImpl.validateMethod(InterfaceExtensionImpl.java:167)
        at
org.apache.xmlbeans.impl.config.InterfaceExtensionImpl.validateMethods(InterfaceExtensionImpl.java:113)
        at
org.apache.xmlbeans.impl.config.InterfaceExtensionImpl.newInstance(InterfaceExtensionImpl.java:58)
        at
org.apache.xmlbeans.impl.config.BindingConfigImpl.recordExtensionSetting(BindingConfigImpl.java:234)
        at
org.apache.xmlbeans.impl.config.BindingConfigImpl.<init>(BindingConfigImpl.java:109)
        at
org.apache.xmlbeans.impl.config.BindingConfigImpl.forConfigDocuments(BindingConfigImpl.java:69)
        at
org.apache.xmlbeans.impl.tool.SchemaCompiler.loadTypeSystem(SchemaCompiler.java:939)
        at
org.apache.xmlbeans.impl.tool.SchemaCompiler.compile(SchemaCompiler.java:1067)
        at
org.apache.xmlbeans.impl.tool.SchemaCompiler.main(SchemaCompiler.java:367)

thanks,

Scott

------------
Scott R. Hinkelman, Senior Software Engineer
IBM Software Group / Emerging Technologies
Cross-Industry Foundation Standards Strategy
Office: 512.823.8097 (TL 793.8097)
Cell: 512.415.8490


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