final public int getChar() throws EOFException, ParseException, EncodingException { int a; if (offset >= endOffset) throw e; a= XMLDoc[offset++]; if (a<0) throw new ParseException( "ASCII encoding error: invalid ASCII Char"); return a; } final public boolean skipChar(int ch)
e.printStackTrace(); } catch (ParseException e) { LOG.error("Error while parsing file " + fileName + ": ", e.getMessage()); e.printStackTrace(); System.exit(1); } catch (ParseExceptionHuge e) {
public static VTDNav getVTDNav(InputStream is, int bufferSize) throws ParseException, FileTooBigException { VTDGen vg = null; try { byte[] data = readStream(is, bufferSize); vg = new VTDGen(); vg.setDoc(data); vg.parse(true); } catch (EncodingException e) { e.printStackTrace(); } catch (EOFException e) { e.printStackTrace(); } catch (EntityException e) { e.printStackTrace(); } catch (FileTooBigException e) { throw e; } catch (IOException e) { e.printStackTrace(); } catch (ParseException e) { String message = e.getMessage(); if (message.contains("file size too big")) throw new FileTooBigException(message); } return vg.getNav(); }
vn = getVTDNav(entryIs, bufferSize); } catch (ParseException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace();
} catch (ParseException e) { LOG.error("Error while parsing document " + identifier); e.printStackTrace(); System.exit(1);
final public int getChar() throws EOFException, ParseException, EncodingException { int a; if (offset >= endOffset) throw e; a= XMLDoc[offset++]; if (a<0) throw new ParseException( "ASCII encoding error: invalid ASCII Char"); return a; } final public boolean skipChar(int ch)
final public int getChar() throws EOFException, ParseException, EncodingException { int a; if (offset >= endOffset) throw e; a= XMLDoc[offset++]; if (a<0) throw new ParseException( "ASCII encoding error: invalid ASCII Char"); return a; } final public boolean skipChar(int ch)
return offset - 4; default : throw new ParseException("Other Error: Should never happen");
return offset - 4; default : throw new ParseException("Other Error: Should never happen");
return offset - 4; default : throw new ParseException("Other Error: Should never happen");
break; default: throw new ParseException( "UTF 8 encoding error: should never happen"); temp = XMLDoc[offset + a - i]; if ((temp & 0xc0) != 0x80) throw new ParseException( "UTF 8 encoding error: should never happen"); val = val | ((temp & 0x3f) << ((i << 2) + (i << 1)));
break; default: throw new ParseException( "UTF 8 encoding error: should never happen"); temp = XMLDoc[offset + a - i]; if ((temp & 0xc0) != 0x80) throw new ParseException( "UTF 8 encoding error: should never happen"); val = val | ((temp & 0x3f) << ((i << 2) + (i << 1)));
break; default: throw new ParseException( "UTF 8 encoding error: should never happen"); temp = XMLDoc[offset + a - i]; if ((temp & 0xc0) != 0x80) throw new ParseException( "UTF 8 encoding error: should never happen"); val = val | ((temp & 0x3f) << ((i << 2) + (i << 1)));
break; default: throw new ParseException( "UTF 8 encoding error: should never happen"); temp = XMLDoc[offset + a - i]; if ((temp & 0xc0) != 0x80) throw new ParseException( "UTF 8 encoding error: should never happen"); val = val | ((temp & 0x3f) << ((i << 2) + (i << 1)));
break; default: throw new ParseException( "UTF 8 encoding error: should never happen"); temp = XMLDoc[offset + a - i]; if ((temp & 0xc0) != 0x80) throw new ParseException( "UTF 8 encoding error: should never happen"); val = val | ((temp & 0x3f) << ((i << 2) + (i << 1)));
break; default: throw new ParseException( "UTF 8 encoding error: should never happen"); temp = XMLDoc[offset + a - i]; if ((temp & 0xc0) != 0x80) throw new ParseException( "UTF 8 encoding error: should never happen"); val = val | ((temp & 0x3f) << ((i << 2) + (i << 1)));
&& XMLDoc[byte_offset+3]=='n' && XMLDoc[byte_offset+4]=='s') throw new ParseException( "xmlns as a ns prefix can't be re-declared" +formatLineNumber(byte_offset)); && XMLDoc[byte_offset+6]=='n' && XMLDoc[byte_offset+7]==0 && XMLDoc[byte_offset+8]=='s' && XMLDoc[byte_offset+9]==0) throw new ParseException( "xmlns as a ns prefix can't be re-declared" +formatLineNumber(byte_offset)); && XMLDoc[byte_offset+6]==0 && XMLDoc[byte_offset+7]=='n' && XMLDoc[byte_offset+8]==0 && XMLDoc[byte_offset+9]=='s') throw new ParseException( "xmlns as a ns prefix can't be re-declared" +formatLineNumber(byte_offset));
&& XMLDoc[byte_offset+3]=='n' && XMLDoc[byte_offset+4]=='s') throw new ParseException( "xmlns as a ns prefix can't be re-declared" +formatLineNumber(byte_offset)); && XMLDoc[byte_offset+6]=='n' && XMLDoc[byte_offset+7]==0 && XMLDoc[byte_offset+8]=='s' && XMLDoc[byte_offset+9]==0) throw new ParseException( "xmlns as a ns prefix can't be re-declared" +formatLineNumber(byte_offset)); && XMLDoc[byte_offset+6]==0 && XMLDoc[byte_offset+7]=='n' && XMLDoc[byte_offset+8]==0 && XMLDoc[byte_offset+9]=='s') throw new ParseException( "xmlns as a ns prefix can't be re-declared" +formatLineNumber(byte_offset));
&& XMLDoc[byte_offset+3]=='n' && XMLDoc[byte_offset+4]=='s') throw new ParseException( "xmlns as a ns prefix can't be re-declared" +formatLineNumber(byte_offset)); && XMLDoc[byte_offset+6]=='n' && XMLDoc[byte_offset+7]==0 && XMLDoc[byte_offset+8]=='s' && XMLDoc[byte_offset+9]==0) throw new ParseException( "xmlns as a ns prefix can't be re-declared" +formatLineNumber(byte_offset)); && XMLDoc[byte_offset+6]==0 && XMLDoc[byte_offset+7]=='n' && XMLDoc[byte_offset+8]==0 && XMLDoc[byte_offset+9]=='s') throw new ParseException( "xmlns as a ns prefix can't be re-declared" +formatLineNumber(byte_offset));
private void handleOtherTextChar(int ch) throws ParseException{ if (ch == '&') { //has_amp = true; if (!XMLChar.isValidChar(entityIdentifier())) throw new ParseException( "Error in text content: Invalid char in text content " + formatLineNumber()); //parser_state = STATE_TEXT; } else if (ch == ']') { if (r.skipChar(']')) { while (r.skipChar(']')) { } if (r.skipChar('>')) throw new ParseException( "Error in text content: ]]> in text content" + formatLineNumber()); } } else throw new ParseException( "Error in text content: Invalid char in text content " + formatLineNumber()); }