users@jaxb.java.net

Re: JAXB Max Exclusive

From: Ed Mooney <Ed.Mooney_at_Sun.COM>
Date: Tue, 27 Jul 2004 09:04:43 -0400

It detects the error when you validate the resulting content tree:

run:
[echo] Running the sample application...
[java] DefaultValidationEventHandler: [ERROR]: the value is out of the
range (maxExclusive specifies 100).
[java] Location: obj: primer.po.impl.ItemsImpl$ItemTypeImpl_at_18d9850
[java] com.sun.xml.bind.serializer.AbortSerializationException: the
value is out of the range (maxExclusive specifies 100).
[java] at
primer.po.impl.runtime.ValidationContext.reportEvent(ValidationContext.java:199)
[java] at
primer.po.impl.runtime.ValidationContext.reportEvent(ValidationContext.java:166)
[java] at
primer.po.impl.runtime.MSVValidator.writePendingText(MSVValidator.java:193)

Reporting an out-of-range error without having to validate relies on an
optional feature of JAXB 1.0 that the current RI doesn't implement.

   -- Ed

trent.andrews_at_rainhail.com wrote:
> I was looking at an example
>
> jwsdp-1.4\jaxb\samples\create-marshal
>
> Excerpt from Schema File
>
> <xsd:element name="quantity">
> <xsd:simpleType>
> <xsd:restriction base="xsd:positiveInteger">
> <xsd:maxExclusive value="100"/>
> </xsd:restriction>
> </xsd:simpleType>
> </xsd:element>
>
> So I changed the Main.java Example to have quantities over 100. Should
> jaxb stop this from happening ?
>
> Thanks
>
> Trent Andrews
> Programmer/Analyst
>
> IT Division of Rain & Hail L.L.C.
> 515-559-1290
> Fax: 515-559-1695
> mailto:trent.andrews_at_rainhail.com
> http://www.rainhail.com <http://www.rainhail.com/>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net