grchiu      2002/12/19 11:03:35

  Modified:    java/src/org/apache/xalan/serialize Tag: xslt20
                        SerializerToXML.java
  Log:
  Migrating patches for bugzillas 6927, 14965 to xslt20 branch.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.16.2.1.2.1 +19 -1     
xml-xalan/java/src/org/apache/xalan/serialize/SerializerToXML.java
  
  Index: SerializerToXML.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/serialize/SerializerToXML.java,v
  retrieving revision 1.16.2.1
  retrieving revision 1.16.2.1.2.1
  diff -u -r1.16.2.1 -r1.16.2.1.2.1
  --- SerializerToXML.java      14 Aug 2002 19:21:27 -0000      1.16.2.1
  +++ SerializerToXML.java      19 Dec 2002 19:03:34 -0000      1.16.2.1.2.1
  @@ -1278,8 +1278,26 @@
       try
       {
         final Writer writer = m_writer;
  +      final int limit = start + length;
  +      boolean wasDash = false;
         writer.write("<!--");
  -      writer.write(ch, start, length);
  +
  +      // Detect occurrences of two consecutive dashes, handle as necessary.
  +      for (int i = start; i < limit; i++) {
  +        if (wasDash && ch[i] == '-') {
  +          writer.write(ch, start, i - start);
  +          writer.write(" -");
  +          start = i + 1;
  +        }
  +        wasDash = (ch[i] == '-');
  +      }
  +
  +      // Output the remaining characters.
  +      writer.write(ch, start, limit - start);
  +      // Protect comment end from a single trailing dash
  +      if (length > 0 && ch[limit-1] == '-')
  +        writer.write(' ');
  +
         writer.write("-->");
       }
       catch(IOException ioe)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to