dlr         2002/08/08 14:31:50

  Modified:    src/java/org/apache/xmlrpc XmlWriter.java
  Log:
  writeObject(): Adam Megacz <[EMAIL PROTECTED]> notes that the keys in a
  Hashtable argument should be XML-escaped.
  
    "The Apache XML-RPC libraries fail to transform '<' into '&lt;' and
    '&' into '&amp;' when they occur in a Hashtable key (<name/>
    element).
  
    This can be fixed by removing this line (XmlRpc.java:756)
  
      write(nextkey);
  
    And replacing it with this line:
  
      chardata(nextkey);"
  
  Revision  Changes    Path
  1.2       +4 -4      xml-rpc/src/java/org/apache/xmlrpc/XmlWriter.java
  
  Index: XmlWriter.java
  ===================================================================
  RCS file: /home/cvs/xml-rpc/src/java/org/apache/xmlrpc/XmlWriter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- XmlWriter.java    7 Aug 2002 17:44:36 -0000       1.1
  +++ XmlWriter.java    8 Aug 2002 21:31:50 -0000       1.2
  @@ -226,13 +226,13 @@
               Hashtable struct = (Hashtable) obj;
               for (Enumeration e = struct.keys(); e.hasMoreElements(); )
               {
  -                String nextkey = (String) e.nextElement();
  -                Object nextval = struct.get(nextkey);
  +                String key = (String) e.nextElement();
  +                Object value = struct.get(key);
                   startElement("member");
                   startElement("name");
  -                write(nextkey);
  +                chardata(key);
                   endElement("name");
  -                writeObject(nextval);
  +                writeObject(value);
                   endElement("member");
               }
               endElement("struct");
  
  
  


Reply via email to