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)
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)
&& 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()); }
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()); }
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()); }
private void handleOtherTextChar2(int ch) throws ParseException{ if (ch == '&') { //has_amp = true; //temp_offset = offset; entityIdentifier(); //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()); } //parser_state = STATE_TEXT; }else throw new ParseException( "Error in text content: Invalid char" + formatLineNumber()); } private int processElementTail(boolean helper) throws ParseException, EncodingException, EOFException{
private void handleOtherTextChar2(int ch) throws ParseException{ if (ch == '&') { //has_amp = true; //temp_offset = offset; entityIdentifier(); //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()); } //parser_state = STATE_TEXT; }else throw new ParseException( "Error in text content: Invalid char" + formatLineNumber()); } private int processElementTail(boolean helper) throws ParseException, EncodingException, EOFException{
private void handleOtherTextChar2(int ch) throws ParseException{ if (ch == '&') { //has_amp = true; //temp_offset = offset; entityIdentifier(); //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()); } //parser_state = STATE_TEXT; }else throw new ParseException( "Error in text content: Invalid char" + formatLineNumber()); } private int processElementTail(boolean helper) throws ParseException, EncodingException, EOFException{
throw new ParseException("Name space qualification Exception: Element not qualified\n" +formatLineNumber((int)currentElementRecord));
private int process_qm_seen()throws ParseException, EncodingException, EOFException { temp_offset = offset; ch = r.getChar(); if (XMLChar.isNameStartChar(ch)) { //temp_offset = offset; if ((ch == 'x' || ch == 'X') && (r.skipChar('m') || r.skipChar('M')) && (r.skipChar('l') || r.skipChar('L'))) { ch = r.getChar(); if (ch == '?' || XMLChar.isSpaceChar(ch)) throw new ParseException( "Error in PI: [xX][mM][lL] not a valid PI targetname" + formatLineNumber()); offset = r.getPrevOffset(); } return STATE_PI_TAG; } throw new ParseException( "Other Error: First char after <? invalid" + formatLineNumber()); } private int process_start_doc()throws ParseException, EncodingException, EOFException {
private int process_qm_seen()throws ParseException, EncodingException, EOFException { temp_offset = offset; ch = r.getChar(); if (XMLChar.isNameStartChar(ch)) { //temp_offset = offset; if ((ch == 'x' || ch == 'X') && (r.skipChar('m') || r.skipChar('M')) && (r.skipChar('l') || r.skipChar('L'))) { ch = r.getChar(); if (ch == '?' || XMLChar.isSpaceChar(ch)) throw new ParseException( "Error in PI: [xX][mM][lL] not a valid PI targetname" + formatLineNumber()); offset = getPrevOffset(); } return STATE_PI_TAG; } throw new ParseException( "Other Error: First char after <? invalid" + formatLineNumber()); } private int process_start_doc()throws ParseException, EncodingException, EOFException {
private int process_qm_seen()throws ParseException, EncodingException, EOFException { temp_offset = offset; ch = r.getChar(); if (XMLChar.isNameStartChar(ch)) { //temp_offset = offset; if ((ch == 'x' || ch == 'X') && (r.skipChar('m') || r.skipChar('M')) && (r.skipChar('l') || r.skipChar('L'))) { ch = r.getChar(); if (ch == '?' || XMLChar.isSpaceChar(ch)) throw new ParseException( "Error in PI: [xX][mM][lL] not a valid PI targetname" + formatLineNumber()); offset = getPrevOffset(); } return STATE_PI_TAG; } throw new ParseException( "Other Error: First char after <? invalid" + formatLineNumber()); } private int process_start_doc()throws ParseException, EncodingException, EOFException {
private int process_end_doc() throws ParseException, EncodingException, EOFException { int parser_state; ch = getCharAfterS(); /* eof exception should be thrown here for premature ending*/ if (ch == '<') { if (r.skipChar('?')) { /* processing instruction after end tag of root element*/ temp_offset = offset; parser_state = STATE_END_PI; return parser_state; } else if ( r.skipChar('!') && r.skipChar('-') && r.skipChar('-')) { // comments allowed after the end tag of the root element temp_offset = offset; parser_state = STATE_END_COMMENT; return parser_state; } } throw new ParseException( "Other Error: XML not terminated properly" + formatLineNumber()); }
private int process_end_doc() throws ParseException, EncodingException, EOFException { int parser_state; ch = getCharAfterS(); /* eof exception should be thrown here for premature ending*/ if (ch == '<') { if (r.skipChar('?')) { /* processing instruction after end tag of root element*/ temp_offset = offset; parser_state = STATE_END_PI; return parser_state; } else if ( r.skipChar('!') && r.skipChar('-') && r.skipChar('-')) { // comments allowed after the end tag of the root element temp_offset = offset; parser_state = STATE_END_COMMENT; return parser_state; } } throw new ParseException( "Other Error: XML not terminated properly" + formatLineNumber()); }
private int process_end_doc() throws ParseException, EncodingException, EOFException { int parser_state; ch = getCharAfterS(); /* eof exception should be thrown here for premature ending*/ if (ch == '<') { if (r.skipChar('?')) { /* processing instruction after end tag of root element*/ temp_offset = offset; parser_state = STATE_END_PI; return parser_state; } else if ( r.skipChar('!') && r.skipChar('-') && r.skipChar('-')) { // comments allowed after the end tag of the root element temp_offset = offset; parser_state = STATE_END_COMMENT; return parser_state; } } throw new ParseException( "Other Error: XML not terminated properly" + formatLineNumber()); }
return STATE_DEC_ATTR_NAME; } else if (r.skipChar('?')) throw new ParseException( "Error in XML decl: Premature ending" + formatLineNumber()); throw new ParseException( "Other Error: XML not starting properly" + formatLineNumber());
return STATE_DEC_ATTR_NAME; } else if (r.skipChar('?')) throw new ParseException( "Error in XML decl: Premature ending" + formatLineNumber()); throw new ParseException( "Other Error: XML not starting properly" + formatLineNumber());
return STATE_DEC_ATTR_NAME; } else if (r.skipChar('?')) throw new ParseException( "Error in XML decl: Premature ending" + formatLineNumber()); throw new ParseException( "Other Error: XML not starting properly" + formatLineNumber());