Skip to content

Commit

Permalink
character entity handling improved
Browse files Browse the repository at this point in the history
  • Loading branch information
haustein committed Jun 11, 2003
1 parent a5edc27 commit 2ced092
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/org/kxml2/io/KXmlParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -651,12 +651,18 @@ private final void pushEntity()
int c = read();
if (c == ';')
break;
if (relaxed && (c == '<' || c == '&' || c <= ' ')) {
if (c != -1) push(c);
return;
}
if (c == -1)
exception(UNEXPECTED_EOF);
if (c < 128
&& (c < '0' || c > '9')
&& (c < 'a' || c > 'z')
&& (c < 'A' || c > 'Z')
&& c != '_' && c != '-' && c != '#') {
if(!relaxed){
exception("unterminated entity ref"); //; ends with:"+(char)c);
}
if (c != -1) push(c);
return;
}

push(c);
}

Expand Down

0 comments on commit 2ced092

Please sign in to comment.