<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2655.35">
<TITLE>Possible inconsistency in Verifier.isXMLCharacter()</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>This is the code from isXMLCharacter().</FONT>
</P>
<P><FONT SIZE=2> public static boolean isXMLCharacter(char c) {</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> if (c == '\n') return true;</FONT>
<BR><FONT SIZE=2> if (c == '\r') return true;</FONT>
<BR><FONT SIZE=2> if (c == '\t') return true;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> if (c < 0x20) return false; if (c <= 0xD7FF) return true;</FONT>
<BR><FONT SIZE=2> if (c < 0xE000) return false; if (c <= 0xFFFD) return true;</FONT>
<BR><FONT SIZE=2> if (c < 0x10000) return false; if (c <= 0x10FFFF) return true;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> return false;</FONT>
<BR><FONT SIZE=2> }</FONT>
</P>
<P><FONT SIZE=2>Now, according to Java spec, chars have value 0x0000 through 0xffff (<A HREF="http://java.sun.com/docs/books/jls/second_edition/html/typesValues.doc.html#9151" TARGET="_blank">http://java.sun.com/docs/books/jls/second_edition/html/typesValues.doc.html#9151</A>)</FONT></P>
<P><FONT SIZE=2>Thus, the line:</FONT>
</P>
<P><FONT SIZE=2>if (c < 0x10000) return false; if (c <= 0x10FFFF) return true;</FONT>
</P>
<P><FONT SIZE=2>is redundant, until there is a java with more than 2 byte chars.</FONT>
</P>
<BR>
<P><FONT SIZE=2>So, whatever characters are meant to be in the range 0x10000 through 0x10FFF they will never validate.</FONT>
</P>
<P><FONT SIZE=2>Rolf</FONT>
</P>
</BODY>
</HTML>