users@jaxb.java.net

RE: pattern in a simple type

From: <oro7d3_at_netscape.net>
Date: Mon, 16 Feb 2004 17:32:32 -0500

But when i unmarshall that object from an inputstream with 'mustUnderstand="false";
I got the following validity exception. It seems like JAXB does know it only takes '0' or '1' for that attribute, but when it marshalls the object, it put 'false' instead of '0'.

Thanks in advance for any idea in solving this.

com.sun.msv.verifier.ValidityViolation: attribute "ns1:mustUnderstand" has a bad value: the value does not match the regular expression "0|1".
    at com.sun.msv.verifier.Verifier.onError(Verifier.java:332)
    at com.sun.msv.verifier.Verifier.onError(Verifier.java:328)
    at com.sun.msv.verifier.Verifier.feedAttribute(Verifier.java:269)
    at com.sun.msv.verifier.Verifier.startElement(Verifier.java:211)
    at com.sun.msv.verifier.VerifierFilter.startElement(VerifierFilter.java:97)
    at org.iso_relax.verifier.impl.ForkContentHandler.startElement(ForkContentHandler.java:75)


oro7d3_at_netscape.net wrote:

>Hi,
>
>I have a question in jaxb. I have this simple type attribute with a pattern value "0" or "1". I have another element which reference this attribute.
>JAXB creates a setMushUnderstand( boolean value); for me.
>But when it marshalls the object, it marshalls 'mustUnderstand="false"' instead of using '0' or '1'.
>
>Is there a way to configure JAXB to marshall either "0" for true, "1" for false?
>
><xs:attribute name="mustUnderstand">
><xs:simpleType>
><xs:restriction base="xs:boolean">
><xs:pattern value="0|1"/>
></xs:restriction>
></xs:simpleType>
></xs:attribute>
>
>__________________________________________________________________
>New! Unlimited Netscape Internet Service.
>Only $9.95 a month -- Sign up today at http://isp.netscape.com/register
>Act now to get a personalized email address!
>
>Netscape. Just the Net You Need.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>

__________________________________________________________________
New! Unlimited Netscape Internet Service.
Only $9.95 a month -- Sign up today at http://isp.netscape.com/register
Act now to get a personalized email address!

Netscape. Just the Net You Need.

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