Return-Path: Delivered-To: apmail-xml-axis-dev-archive@xml.apache.org Received: (qmail 82259 invoked by uid 500); 1 Dec 2001 00:33:43 -0000 Mailing-List: contact axis-dev-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@xml.apache.org Received: (qmail 82244 invoked from network); 1 Dec 2001 00:33:43 -0000 From: "James M Snell" Importance: High To: "Sam Ruby" , axis-dev@xml.apache.org Subject: Axis Serialization Problem X-Mailer: Lotus Notes Release 5.0.5 September 22, 2000 Message-ID: Sender: "James M Snell" Date: Fri, 30 Nov 2001 16:33:48 -0800 X-MIMETrack: Serialize by Router on D03NM035/03/M/IBM(Release 5.0.8 |June 18, 2001) at 11/30/2001 05:33:49 PM, Serialize complete at 11/30/2001 05:33:49 PM MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Sam, The serialization problem I was running into has to do with the fact that the SAX Parser automatically replaces entities with their expanded forms. So & always becomes &. The sax recorder records the "&". When the SAXOutputer calls the SerializationContext's writeChars(...) method, it is passing it only the &. So the change needs to be made in the writeChars method. The current writeChars method shown below: public void writeChars(char [] p1, int p2, int p3) throws IOException { if (writingStartTag) { writer.write(">"); writingStartTag = false; } writer.write(p1, p2, p3); writer.flush(); onlyXML=false; } Needs to change: public void writeChars(char[] p1, int p2, int p3) throws IOException { writeSafeString(String.valueOf(p1,p2,p3)); } This will ensure that all ampersands and other standard entities are properly escaped in the reserialized results. I see no other way around it. Unless you can think of a better workaround, I will commit this change. Please let me know ASAP as I need this to get fixed right away. - James M Snell/Fresno/IBM Web services architecture and strategy Internet Emerging Technologies, IBM 544.9035 TIE line 559.587.1233 Office 919.486.0077 Voice Mail jasnell@us.ibm.com ================================================================= Have I not commanded you? Be strong and courageous. Do not be terrified, do not be discouraged, for the Lord your God will be with you wherever you go. - Joshua 1:9