You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Ole Matzura <ol...@eviware.com> on 2008/09/12 11:30:50 UTC

SchemaProperty returning null for maxOccurs = unbounded

Hi!

 

I'm having an problem where a SchemaProperty retrieved with
getElementProperties() for an element with maxOccurs="unbounded" returns
null from getMaxOccurs().. shouldn't it return MAX_INT or something? The
underlying SchemaTypeSystem was created dynamically from an xsd with
XmlBeans.compileXsd and not from an precompiled jar/xsb (if that should
matter..)

 

Thanks for any reply!

 

Regards,

 

/Ole

Eviware.com


RE: SchemaProperty returning null for maxOccurs = unbounded

Posted by Ole Matzura <ol...@eviware.com>.
Hi,

 

Sure thing.. thanks for clarifying!

 

Best Regards,

 

/Ole

Eviware.com

 

From: Radu Preotiuc-Pietro [mailto:radu.preotiuc-pietro@oracle.com] 
Sent: Saturday, September 13, 2008 00:14
To: user@xmlbeans.apache.org
Subject: RE: SchemaProperty returning null for maxOccurs = unbounded

 

The API of SchemaProperty.getMaxOccurs() states: "     * Returns the
maxOccurs value for this particle, or null if it     * is unbounded." It's a
design choice. If we returned MAX_INT then we wouldn't e able to handle the
case when maxOccurs is > MAX_INT, right? If you are not worried about that
case, just use SchemaProperty.getIntMaxOccurs() which will indeed return
MAX_INT for the "unbounded" case. Fair enough?

 

Radu

 


  _____  


From: Ole Matzura [mailto:ole@eviware.com] 
Sent: Friday, September 12, 2008 2:31 AM
To: user@xmlbeans.apache.org
Subject: SchemaProperty returning null for maxOccurs = unbounded

Hi!

 

I'm having an problem where a SchemaProperty retrieved with
getElementProperties() for an element with maxOccurs="unbounded" returns
null from getMaxOccurs().. shouldn't it return MAX_INT or something? The
underlying SchemaTypeSystem was created dynamically from an xsd with
XmlBeans.compileXsd and not from an precompiled jar/xsb (if that should
matter..)

 

Thanks for any reply!

 

Regards,

 

/Ole

Eviware.com


RE: SchemaProperty returning null for maxOccurs = unbounded

Posted by Radu Preotiuc-Pietro <ra...@oracle.com>.
The API of SchemaProperty.getMaxOccurs() states: "     * Returns the maxOccurs value for this particle, or null if it     * is unbounded." It's a design choice. If we returned MAX_INT then we wouldn't e able to handle the case when maxOccurs is > MAX_INT, right? If you are not worried about that case, just use SchemaProperty.getIntMaxOccurs() which will indeed return MAX_INT for the "unbounded" case. Fair enough?
 
Radu


________________________________

	From: Ole Matzura [mailto:ole@eviware.com] 
	Sent: Friday, September 12, 2008 2:31 AM
	To: user@xmlbeans.apache.org
	Subject: SchemaProperty returning null for maxOccurs = unbounded
	
	

	Hi!

	 

	I'm having an problem where a SchemaProperty retrieved with getElementProperties() for an element with maxOccurs="unbounded" returns null from getMaxOccurs().. shouldn't it return MAX_INT or something? The underlying SchemaTypeSystem was created dynamically from an xsd with XmlBeans.compileXsd and not from an precompiled jar/xsb (if that should matter..)

	 

	Thanks for any reply!

	 

	Regards,

	 

	/Ole

	Eviware.com