}
else if (ch == '!') {
final char read1 = reader.read();
final char read2 = reader.read();
if (read1 != '-' || read2 != '-') {
throw new XMLParseException(reader.getSystemID(), reader.getLineNr(), "Invalid input: <!"
+ read1 + read2);
}
inComment = true;
waitingBuf.append("<!--");
continue;
}
else {
level++;
}
waitingBuf.append('<');
}
else if (ch == '/') {
ch = reader.read();
if (ch == '>') {
level--;
if (level == 0) {
throw new XMLParseException(reader.getSystemID(), reader.getLineNr(), "Invalid input: />");
}
}
else if (ch == '<') {
waitingBuf.append('/');
reader.unread(ch);