protected void printEscaped( String source ) throws IOException { int length = source.length(); for ( int i = 0 ; i < length ; ++i ) { int ch = source.charAt(i); if (!XML11Char.isXML11Valid(ch)) { if (++i <length) { surrogates(ch, source.charAt(i)); } else { fatalError("The character '"+(char)ch+"' is an invalid XML character"); } continue; } if (ch == '\n' || ch == '\r' || ch == '\t' || ch == 0x0085 || ch == 0x2028){ printHex(ch); } else if (ch == '<') { _printer.printText("<"); } else if (ch == '&') { _printer.printText("&"); } else if (ch == '"') { _printer.printText("""); } else if ((ch >= ' ' && _encodingInfo.isPrintable((char) ch))) { _printer.printText((char) ch); } else { printHex(ch); } } }
protected void printEscaped(String source) throws IOException { int length = source.length(); for (int i = 0; i < length; ++i) { int ch = source.charAt(i); if (!XMLChar.isValid(ch)) { if (++i < length) { surrogates(ch, source.charAt(i)); } else { fatalError("The character '" + (char) ch + "' is an invalid XML character"); } continue; } // escape NL, CR, TAB if (ch == '\n' || ch == '\r' || ch == '\t') { printHex(ch); } else if (ch == '<') { _printer.printText("<"); } else if (ch == '&') { _printer.printText("&"); } else if (ch == '"') { _printer.printText("""); } else if ((ch >= ' ' && _encodingInfo.isPrintable((char) ch))) { _printer.printText((char) ch); } else { printHex(ch); } } }
protected void printEscaped( String source ) throws IOException { int length = source.length(); for ( int i = 0 ; i < length ; ++i ) { int ch = source.charAt(i); if (!XML11Char.isXML11Valid(ch)) { if (++i <length) { surrogates(ch, source.charAt(i)); } else { fatalError("The character '"+(char)ch+"' is an invalid XML character"); } continue; } if (ch == '\n' || ch == '\r' || ch == '\t' || ch == 0x0085 || ch == 0x2028){ printHex(ch); } else if (ch == '<') { _printer.printText("<"); } else if (ch == '&') { _printer.printText("&"); } else if (ch == '"') { _printer.printText("""); } else if ((ch >= ' ' && _encodingInfo.isPrintable((char) ch))) { _printer.printText((char) ch); } else { printHex(ch); } } }
protected void printEscaped(String source) throws IOException { int length = source.length(); for (int i = 0; i < length; ++i) { int ch = source.charAt(i); if (!XMLChar.isValid(ch)) { if (++i < length) { surrogates(ch, source.charAt(i)); } else { fatalError("The character '" + (char) ch + "' is an invalid XML character"); } continue; } // escape NL, CR, TAB if (ch == '\n' || ch == '\r' || ch == '\t') { printHex(ch); } else if (ch == '<') { _printer.printText("<"); } else if (ch == '&') { _printer.printText("&"); } else if (ch == '"') { _printer.printText("""); } else if ((ch >= ' ' && _encodingInfo.isPrintable((char) ch))) { _printer.printText((char) ch); } else { printHex(ch); } } }
/** print text data */ protected void printXMLChar( int ch) throws IOException { if (ch == '\r') { printHex(ch); } else if ( ch == '<') { _printer.printText("<"); } else if (ch == '&') { _printer.printText("&"); } else if (ch == '>'){ // character sequence "]]>" can't appear in content, therefore // we should escape '>' _printer.printText(">"); } else if ( ch == '\n' || ch == '\t' || ( ch >= ' ' && _encodingInfo.isPrintable((char)ch))) { _printer.printText((char)ch); } else { printHex(ch); } }
/** print text data */ protected void printXMLChar( int ch) throws IOException { if (ch == '\r') { printHex(ch); } else if ( ch == '<') { _printer.printText("<"); } else if (ch == '&') { _printer.printText("&"); } else if (ch == '>'){ // character sequence "]]>" can't appear in content, therefore // we should escape '>' _printer.printText(">"); } else if ( ch == '\n' || ch == '\t' || ( ch >= ' ' && _encodingInfo.isPrintable((char)ch))) { _printer.printText((char)ch); } else { printHex(ch); } }
if (_encodingInfo.isPrintable((char) ch) && XML11Char.isXML11ValidLiteral(ch)) { _printer.printText((char) ch);
protected final void printXMLChar( int ch ) throws IOException { if (ch == '\r' || ch == 0x0085 || ch == 0x2028) { printHex(ch); } else if ( ch == '<') { _printer.printText("<"); } else if (ch == '&') { _printer.printText("&"); } else if (ch == '>'){ // character sequence "]]>" can't appear in content, therefore // we should escape '>' _printer.printText(">"); } else if ( _encodingInfo.isPrintable((char)ch) && XML11Char.isXML11ValidLiteral(ch)) { _printer.printText((char)ch); } else { printHex(ch); } }
if (_encodingInfo.isPrintable((char) ch) && XML11Char.isXML11ValidLiteral(ch)) { _printer.printText((char) ch);
protected final void printXMLChar( int ch ) throws IOException { if (ch == '\r' || ch == 0x0085 || ch == 0x2028) { printHex(ch); } else if ( ch == '<') { _printer.printText("<"); } else if (ch == '&') { _printer.printText("&"); } else if (ch == '>'){ // character sequence "]]>" can't appear in content, therefore // we should escape '>' _printer.printText(">"); } else if ( _encodingInfo.isPrintable((char)ch) && XML11Char.isXML11ValidLiteral(ch)) { _printer.printText((char)ch); } else { printHex(ch); } }
if ( ( ch >= ' ' && _encodingInfo.isPrintable((char)ch) && ch != 0xF7 ) || ch == '\n' || ch == '\r' || ch == '\t' ) { _printer.printText((char)ch);
if ( ( ch >= ' ' && _encodingInfo.isPrintable((char)ch) && ch != 0xF7 ) || ch == '\n' || ch == '\r' || ch == '\t' ) { _printer.printText((char)ch);
protected void printEscaped( int ch ) throws IOException { String charRef; // If there is a suitable entity reference for this // character, print it. The list of available entity // references is almost but not identical between // XML and HTML. charRef = getEntityRef( ch ); if ( charRef != null ) { _printer.printText( '&' ); _printer.printText( charRef ); _printer.printText( ';' ); } else if ( ( ch >= ' ' && _encodingInfo.isPrintable((char)ch) && ch != 0xF7 ) || ch == '\n' || ch == '\r' || ch == '\t' ) { // Non printables are below ASCII space but not tab or line // terminator, ASCII delete, or above a certain Unicode threshold. if (ch < 0x10000) { _printer.printText((char)ch ); } else { _printer.printText((char)(((ch-0x10000)>>10)+0xd800)); _printer.printText((char)(((ch-0x10000)&0x3ff)+0xdc00)); } } else { printHex(ch); } }
protected void printEscaped( int ch ) throws IOException { String charRef; // If there is a suitable entity reference for this // character, print it. The list of available entity // references is almost but not identical between // XML and HTML. charRef = getEntityRef( ch ); if ( charRef != null ) { _printer.printText( '&' ); _printer.printText( charRef ); _printer.printText( ';' ); } else if ( ( ch >= ' ' && _encodingInfo.isPrintable((char)ch) && ch != 0xF7 ) || ch == '\n' || ch == '\r' || ch == '\t' ) { // Non printables are below ASCII space but not tab or line // terminator, ASCII delete, or above a certain Unicode threshold. if (ch < 0x10000) { _printer.printText((char)ch ); } else { _printer.printText((char)(((ch-0x10000)>>10)+0xd800)); _printer.printText((char)(((ch-0x10000)&0x3ff)+0xdc00)); } } else { printHex(ch); } }
if ( _encodingInfo.isPrintable((char)ch) && XML11Char.isXML11ValidLiteral(ch)) { _printer.printText((char)ch); } else {
if ( ( ch >= ' ' && _encodingInfo.isPrintable((char)ch) && ch != 0xF7 ) || ch == '\n' || ch == '\r' || ch == '\t' ) { _printer.printText((char)ch);
if ( ( ch >= ' ' && _encodingInfo.isPrintable((char)ch) && ch != 0xF7 ) || ch == '\n' || ch == '\r' || ch == '\t' ) { _printer.printText((char)ch);
if ( _encodingInfo.isPrintable((char)ch) && XML11Char.isXML11ValidLiteral(ch)) { _printer.printText((char)ch); } else {