DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8292>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8292 SAX parser modifies the InputSource Summary: SAX parser modifies the InputSource Product: Xerces2-J Version: 2.0.1 Platform: Sun OS/Version: Windows NT/2K Status: NEW Severity: Normal Priority: Other Component: SAX AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Hi, I am setting an entity via an entity resolver.The SAX parser at the end of the process modifies this entity in an unpredictable way. If I use a characterstream with in an InputSource, it becomes null after the SAX parser operates on it and if I have a bytestream encapsulated in the InputSource then the bytestream gets corrupt after the SAX operation. I am attaching the code in here, in the process method I assign an entity resolver and then parse the given XML document to which I provide the Schema document (gschemaDoc) in the entutyresolver.The first time I do this things work fine but then if i repeat the same process again,I find that the gschemaDoc has been manipulated. public void process(String jobID) throws MapAtomException { try { gDataOut = null; myEntityResolver entityResolver = new myEntityResolver(); myErrorHandler errorHandler = new myErrorHandler(); gdb.setErrorHandler(errorHandler); gdb.setEntityResolver(entityResolver); ByteArrayInputStream bin = new ByteArrayInputStream ((gDataIn.getXMLMSGPayload().toString().getBytes())); validateResult=""; gdb.parse(bin); } catch(SAXException saxExcp) { gwasValid = false; return; } catch(IOException ioExcp) { throw new MapAtomException(20,"process()","ValidateAtom"); } catch(MBMException mbmExcp) { throw new MapAtomException(mbmExcp.getMessage(),"process ()","ValidateAtom"); } } class myEntityResolver implements EntityResolver { public InputSource resolveEntity (String publicId, String systemId) { return gschemaDoc; } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
