I think there is a bug in that method :
public static boolean isQname(String s) {
int len = s.length();
if (len == 0)
return false;
if (!isNameStartCharNs(s.charAt(0)))
return false;
for (int i = 1; i < len; i++) {
char c = s.charAt(i);
if (!isNameChar(c)) {
if (c == ':' && ++i < len && isNameStartCharNs(s.charAt(i))) {
for (++i; i < len; i++)
if (!isNameCharNs(s.charAt(i)))
return false;
return true;
}
return false;
}
}
return true;
}
The test if (!isNameChar(c)) {
will return false if c is ':' so it will not come to the next line.
I think that line should be replaced by
if (!isNameCharNs(c)) {
See Junit attached
Original issue reported on code.google.com by ndebeiss@gmail.com on 26 Jan 2009 at 3:11
Original issue reported on code.google.com by
ndebeiss@gmail.com
on 26 Jan 2009 at 3:11Attachments: