axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James M Snell" <>
Subject Axis Serialization Problem
Date Sat, 01 Dec 2001 00:33:48 GMT

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 &amp; 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 

The current writeChars method shown below:

    public void writeChars(char [] p1, int p2, int p3)
        throws IOException
        if (writingStartTag) {
            writingStartTag = false;
        writer.write(p1, p2, p3); 

Needs to change:

   public void writeChars(char[] p1, int p2, int p3)
        throws IOException 

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
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 
- Joshua 1:9

View raw message