xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minc...@apache.org
Subject svn commit: r384575 - /xalan/java/trunk/src/org/apache/xml/serializer/ToHTMLStream.java
Date Thu, 09 Mar 2006 18:14:59 GMT
Author: minchau
Date: Thu Mar  9 10:14:57 2006
New Revision: 384575

URL: http://svn.apache.org/viewcvs?rev=384575&view=rev
Log:
Added a special case for '&' when outputting an attribute
value that is a URI in HTML output. Committing the fix for
XALANJ-611

Modified:
    xalan/java/trunk/src/org/apache/xml/serializer/ToHTMLStream.java

Modified: xalan/java/trunk/src/org/apache/xml/serializer/ToHTMLStream.java
URL: http://svn.apache.org/viewcvs/xalan/java/trunk/src/org/apache/xml/serializer/ToHTMLStream.java?rev=384575&r1=384574&r2=384575&view=diff
==============================================================================
--- xalan/java/trunk/src/org/apache/xml/serializer/ToHTMLStream.java (original)
+++ xalan/java/trunk/src/org/apache/xml/serializer/ToHTMLStream.java Thu Mar  9 10:14:57 2006
@@ -1312,6 +1312,19 @@
                 // We now we reset the next possible clean character.
                 cleanStart = i + 1;    
             }
+            else if (ch == '&')
+            {
+                // HTML 4.01 reads, "Authors should use "&" (ASCII decimal 38) 
+                // instead of "&" to avoid confusion with the beginning of a character

+                // reference (entity reference open delimiter). 
+                if (cleanLength > 0)
+                {
+                    writer.write(chars, cleanStart, cleanLength);
+                    cleanLength = 0;
+                } 
+                writer.write("&");
+                cleanStart = i + 1; 
+            }
             else
             {
                 // no processing for this character, just count how



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


Mime
View raw message