fix bug in XML parser for Validator

This commit is contained in:
Grahame Grieve 2020-06-09 17:20:35 +10:00
parent 17fb1462c4
commit 6b7aa93dc7
1 changed files with 6 additions and 1 deletions

View File

@ -687,6 +687,11 @@ private boolean elementIsOk(String name) throws FHIRFormatError {
readChar(); readChar();
} }
private void skipWhiteSpaceInternal() throws IOException {
while (Character.isWhitespace(peekChar()) || (peekChar() == 0xfeff))
readChar();
}
private void pushChar(char ch) { private void pushChar(char ch) {
cache = Character.toString(ch)+cache; cache = Character.toString(ch)+cache;
} }
@ -1151,7 +1156,7 @@ private boolean elementIsOk(String name) throws FHIRFormatError {
readChar(); readChar();
if (peekChar() == '?') { if (peekChar() == '?') {
readToTagEnd(); readToTagEnd();
skipWhiteSpace(); skipWhiteSpaceInternal();
if (peekChar() != '<') if (peekChar() != '<')
throw new FHIRException("Unable to Parse HTML - does not start with tag after processing instruction. Found "+peekChar()+descLoc()); throw new FHIRException("Unable to Parse HTML - does not start with tag after processing instruction. Found "+peekChar()+descLoc());
readChar(); readChar();