You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by sa...@apache.org on 2001/11/05 16:30:11 UTC

cvs commit: xml-xerces/java/src/org/apache/xml/serialize XMLSerializer.java

sandygao    01/11/05 07:30:11

  Modified:    java/src/org/apache/xml/serialize Tag: xerces_j_1
                        XMLSerializer.java
  Log:
  Bug fixing [2783]: the handling of attributes "xmlns???" was not correct in XMLSerializer.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.22.2.1  +10 -16    xml-xerces/java/src/org/apache/xml/serialize/XMLSerializer.java
  
  Index: XMLSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/XMLSerializer.java,v
  retrieving revision 1.22
  retrieving revision 1.22.2.1
  diff -u -r1.22 -r1.22.2.1
  --- XMLSerializer.java	2001/06/11 20:08:26	1.22
  +++ XMLSerializer.java	2001/11/05 15:30:10	1.22.2.1
  @@ -114,7 +114,7 @@
    * spaces at beginning of line will be stripped.
    *
    *
  - * @version $Revision: 1.22 $ $Date: 2001/06/11 20:08:26 $
  + * @version $Revision: 1.22.2.1 $ $Date: 2001/11/05 15:30:10 $
    * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
    * @see Serializer
    */
  @@ -558,7 +558,7 @@
                           _printer.printText( " SYSTEM " );
                           printDoctypeURL( _docTypeSystemId );
                       }
  -                    
  +
                       // If we accumulated any DTD contents while printing.
                       // this would be the place to print it.
                       if ( dtd != null && dtd.length() > 0 ) {
  @@ -566,7 +566,7 @@
                           printText( dtd, true, true );
                           _printer.printText( ']' );
                       }
  -                    
  +
                       _printer.printText( ">" );
                       _printer.breakLine();
                   } else if ( dtd != null && dtd.length() > 0 ) {
  @@ -742,23 +742,17 @@
               //Append only when the feature http://xml.org/sax/features/namespace-prefixes"
               //is TRUE
               if ( rawName.startsWith( "xmlns" ) ) {
  -                indexColon = rawName.indexOf( ':' );
  -
  -                //is there a prefix
  -                if ( indexColon != -1 && ( indexColon + 1 ) < rawName.length() )
  -                    prefix = rawName.substring( indexColon + 1 );
  -                else
  -                    prefix = "";
  -
  -                startPrefixMapping( prefix, attrs.getValue( i ) );
  -                //Remove it
  -                attrsOnly.removeAttribute( i );
  +                if (rawName.length() == 5) {
  +                    startPrefixMapping( "", attrs.getValue( i ) );
  +                    attrsOnly.removeAttribute( i );
  +                } else if (rawName.charAt(5) == ':') {
  +                    startPrefixMapping(rawName.substring(6), attrs.getValue(i));
  +                    attrsOnly.removeAttribute( i );
  +                }
               }
           }
           return attrsOnly;
       }
  -
  -
   }
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org