users@jaxb.java.net

marshalling invalid XML?

From: Marc Dumontier <mrdumont_at_blueprint.org>
Date: Thu, 27 May 2004 11:14:33 -0400

Hi,

I've noticed that the following behavior can occur:

Using JAXB I marshall a content tree. There's an element (xs:string)
which has been filled with characters including an ASCII 0x2, and 0x6.
This marshalls fine.

JAXB cannot unmarshall this document back

[org.blueprint.bind.framework.mappers.jaxb.JAXBGeneralMapper.unmarshalFromXML:269]: javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x2) was found in the element content of the document.]
        at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:306)
        at com.sun.xml.bind.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:134)
        at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:139)
        at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:107)
        at org.blueprint.bind.framework.mappers.jaxb.JAXBGeneralMapper.unmarshalFromXML(JAXBGeneralMapper.java:267)

....


Xerces seems unable to parse this XML either.

I really don't know much about encodings so I hope someone can help me
shed some light on this. I'm not sure if JAXB should be marshalling this
content, or rather if it should be able to unmarshall it. I do know that
if JAXB writes it, it should also read it.

Thanks,

Marc Dumontier
Bioinformatics Software Developer
Blueprint Initiative, Mount Sinai Hospital
Toronto,ON
http://www.blueprint.org



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