You can not specify a character-encoding when converting the byte array to a string - it doesn't work. I, personally, would consider the encoding code broken - it doesn't throw an exception if it comes across a byte (or byte combination) that can't be encoded into the desired character set - it just skips it.
-----Original Message----- From: Eduardo Y�nez [mailto:[EMAIL PROTECTED] Sent: Monday, April 02, 2001 8:16 AM To: [EMAIL PROTECTED] Subject: SAX report errors out of time Hi every body, This may be an old issue, if it is, please excuse me. Could any body tell me why SAX2 report an xml instance error (according to a suplied xml schema) only when the parent of the problematic node is closed? What if i have the following schema: <?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://www.w3.org/2000/10/XMLSchema"> <element name="Customers"> <complexType> <sequence> <element ref="customer" maxOccurs="unbounded"/> </sequence> </complexType> </element> <element name="customer"> <complexType> <attribute name="haveInfo"> <simpleType> <restriction base="string"> <enumeration value="true"/> <enumeration value="false"/> </restriction> </simpleType> </attribute> <attribute name="customerId" use="required"> <simpleType> <restriction base="string"> <minLength value="16"/> <maxLength value="20"/> </restriction> </simpleType> </attribute> </complexType> </element> </schema> And the following xml file, through which i wish to update a database column: <?xml version="1.0" encoding="UTF-8"?> <Customers xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Customers.xsd"> <customer customerId="6517514000000000" haveInfo="true"/> <customer haveInfo="true"/> <!-- An error!!! --> <customer customerId="6517514999999999"/> <!-- ** any number of customer nodes ** --> <customer customerId="6517514999999999" haveInfo="true"/> </Customers> <!-- The error is reported here?!? --> How could i handle the error in the moment it occurs?. I used the SAX2Writer sample that comes with the Xerces 1.3.0 distribution for doing this tests. I think that the error callback should be called immediately an error node (not conforming to the schema) is found. Isn�t it? We can work around the problem, but don�t you think that SAX2 should work this kind of problems immediately? Thanks for your help! Regards, Eduardo Yanez. _________________________________________________________ Do You Yahoo!? Obtenga su direcci�n de correo-e gratis @yahoo.com en http://correo.espanol.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
