You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by md...@home.com,
md...@home.com on 2000/06/27 05:25:31 UTC
[PATCH] BaseMarkupSerializer interpreting newlines (white space) with preserveSpace on
*** BaseMarkupSerializer.java.orig Mon Jun 26 19:46:36 2000
--- BaseMarkupSerializer.java Mon Jun 26 19:47:58 2000
***************
*** 1170,1185 ****
char ch;
if ( preserveSpace ) {
! // Preserving spaces: the text must print exactly as it is,
! // without breaking when spaces appear in the text and without
! // consolidating spaces. If a line terminator is used, a line
! // break will occur.
while ( length-- > 0 ) {
ch = chars[ start ];
++start;
! if ( ch == '\n' || ch == '\r' )
! _printer.breakLine( true );
! else if ( unescaped )
_printer.printText( ch );
else
printEscaped( ch );
--- 1170,1182 ----
char ch;
if ( preserveSpace ) {
! // Preserving white space: the text must print exactly as it is,
! // without breaking when white space appears in the text and
! // without consolidating white space. This includes linebreaks.
while ( length-- > 0 ) {
ch = chars[ start ];
++start;
! if ( unescaped )
_printer.printText( ch );
else
printEscaped( ch );
***************
*** 1210,1224 ****
char ch;
if ( preserveSpace ) {
! // Preserving spaces: the text must print exactly as it is,
! // without breaking when spaces appear in the text and without
! // consolidating spaces. If a line terminator is used, a line
! // break will occur.
for ( index = 0 ; index < text.length() ; ++index ) {
ch = text.charAt( index );
! if ( ch == '\n' || ch == '\r' )
! _printer.breakLine( true );
! else if ( unescaped )
_printer.printText( ch );
else
printEscaped( ch );
--- 1207,1218 ----
char ch;
if ( preserveSpace ) {
! // Preserving white space: the text must print exactly as it is,
! // without breaking when white space appears in the text and
! // without consolidating white space. This includes line breaks.
for ( index = 0 ; index < text.length() ; ++index ) {
ch = text.charAt( index );
! if ( unescaped )
_printer.printText( ch );
else
printEscaped( ch );