Hi Jeffrey,
I do remember that - now and then - issues have been reported related to
unbounded choices and broken validation code. I will be having a
detailed look later on this week, but I simply do not have the time to
do this right now.
There's only one work-around I can suggest: can you - i a custom
castor.properties file - please override the following property:
# Property that allows to specify whether the validation for
# <xs:integer> should accept the old 'int/Integer' members
# as well; default to false.
#
org.exolab.castor.xml.lenient.integer.validation=true
and see whether that makes a difference ?
Regards
Werner Guttmann
[EMAIL PROTECTED] wrote:
> ----- Forwarded by Jeffrey Kramer/USA/DDS on 10/29/2008 04:53 PM -----
>
>
>
>
> Hi Werner,
>
> I should have mentioned initially this is Castor version 1.2 on a windows
> xp machine with java version 1.5.0_16.
>
> It looks like the major question here is how Castor is handling the
> attributes of the Choice elements & it's respective nested simple elements
>
>
> under the following assumption:
>
> The expression <xs:choice maxOccurs="unbounded"> allows the contents to be
> repeated one or more times.
> The expression <xs:element name="X" maxOccurs="unbounded"> allows the
> single element to be repeated one or more times
>
>
> For xml containing:
>
> ...
> <foo>1</foo>
> <foo>2</foo>
> <office>NY</office>
> ...
>
> I've observed the following cases:
>
>
> (1) maxOccurs attribute set in choice element
>
> <xs:choice maxOccurs="unbounded">
> <xs:element name="foo" type="xs:string" minOccurs="1" />
> </xs:choice>
>
>
> => works without error
>
> (2) Here the case where the choice element does not have a maxOccurs
> attribute set ( default = 1)
>
> <xs:choice >
> <xs:element name="foo" type="xs:string" minOccurs="1"
> maxOccurs="unbounded" />
> </xs:choice>
> <office>NY</office>
>
> => throws the following exception:
>
> -- org.exolab.castor.xml.MarshalException: Element with name foo passed to
> type companyEmployee in incorrect order; expected element with name
> 'office' or any other optional element declared prior to it.{File: [not
> available]; line: 9; column: 7}
>
> This 2nd case is actually a format we're interested in using. Any
> insight or suggestion you may be able to provide would be greatly
> appreciated.
>
> Thanks,
>
> Jeff
>
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email