You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2003/12/10 19:25:11 UTC
cvs commit: xml-xerces/java/src/org/apache/xml/serialize HTMLSerializer.java
mrglavas 2003/12/10 10:25:11
Modified: java/src/org/apache/xml/serialize HTMLSerializer.java
Log:
Fixing Bug #6878:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6878
The root element of an XHTML document is 'html' [1] and so the
DOCTYPE should be declared as such.
[1] http://www.w3.org/TR/xhtml1/#strict
Revision Changes Path
1.24 +13 -3 xml-xerces/java/src/org/apache/xml/serialize/HTMLSerializer.java
Index: HTMLSerializer.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/HTMLSerializer.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- HTMLSerializer.java 23 Sep 2003 21:42:31 -0000 1.23
+++ HTMLSerializer.java 10 Dec 2003 18:25:11 -0000 1.24
@@ -672,7 +672,12 @@
// HTML: If public identifier specified, print it with
// system identifier, if specified.
if ( _docTypePublicId != null && ( ! _xhtml || _docTypeSystemId != null ) ) {
- _printer.printText( "<!DOCTYPE HTML PUBLIC " );
+ if (_xhtml) {
+ _printer.printText( "<!DOCTYPE html PUBLIC " );
+ }
+ else {
+ _printer.printText( "<!DOCTYPE HTML PUBLIC " );
+ }
printDoctypeURL( _docTypePublicId );
if ( _docTypeSystemId != null ) {
if ( _indenting ) {
@@ -685,7 +690,12 @@
_printer.printText( '>' );
_printer.breakLine();
} else if ( _docTypeSystemId != null ) {
- _printer.printText( "<!DOCTYPE HTML SYSTEM " );
+ if (_xhtml) {
+ _printer.printText( "<!DOCTYPE html SYSTEM " );
+ }
+ else {
+ _printer.printText( "<!DOCTYPE HTML SYSTEM " );
+ }
printDoctypeURL( _docTypeSystemId );
_printer.printText( '>' );
_printer.breakLine();
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org