if (encoding < FORMAT_UTF_16BE) writeVTD( temp_offset, 7, TOKEN_DEC_ATTR_VAL, depth); else
	private int process_dec_attr() throws ParseException, EncodingException, EOFException{		int length1;		int parser_state;		if (ch == 'v'			&& r.skipChar('e')			&& r.skipChar('r')			&& r.skipChar('s')			&& r.skipChar('i')			&& r.skipChar('o')			&& r.skipChar('n')) {			ch = getCharAfterS();			if (ch == '=') {				/*System.out.println(				    " " + (temp_offset - 1) + " " + 7 + " dec attr name version " + depth);*/				if (encoding < FORMAT_UTF_16BE)					writeVTD(						temp_offset - 1,						7,						TOKEN_DEC_ATTR_NAME,						depth);				else					writeVTD(						(temp_offset -2) >> 1,						7,						TOKEN_DEC_ATTR_NAME,						depth);			} else				throw new ParseException(					"XML decl error: Invalid char"						+ formatLineNumber());		} else			throw new ParseException(				"XML decl error: should be version"					+ formatLineNumber());		ch_temp = getCharAfterS();		if (ch_temp != '\'' && ch_temp != '"')			throw new ParseException(				"XML decl error: Invalid char to start attr name"					+ formatLineNumber());		temp_offset = offset;		// support 1.0 or 1.1		if (r.skipChar('1')			&& r.skipChar('.')			&& (r.skipChar('0') || r.skipChar('1'))) {			/*System.out.println(			    " " + temp_offset + " " + 3 + " dec attr val (version)" + depth);*/			if (encoding < FORMAT_UTF_16BE)				writeVTD(					temp_offset,					3,					TOKEN_DEC_ATTR_VAL,					depth);			else				writeVTD(					temp_offset >> 1,					3,					TOKEN_DEC_ATTR_VAL,					depth);		} else			throw new ParseException(				"XML decl error: Invalid version(other than 1.0 or 1.1) detected"					+ formatLineNumber());		if (!r.skipChar(ch_temp))			throw new ParseException(				"XML decl error: version not terminated properly"					+ formatLineNumber());		ch = r.getChar();		//? space or e 		if (XMLChar.isSpaceChar(ch)) {			ch = getCharAfterS();			temp_offset = offset - increment;			if (ch == 'e') {				if (r.skipChar('n')					&& r.skipChar('c')					&& r.skipChar('o')					&& r.skipChar('d')					&& r.skipChar('i')					&& r.skipChar('n')					&& r.skipChar('g')) {					ch = r.getChar();					if (XMLChar.isSpaceChar(ch))						ch = getCharAfterS();					if (ch == '=') {						/*System.out.println(						    " " + (temp_offset) + " " + 8 + " dec attr name (encoding) " + depth);*/						if (encoding < FORMAT_UTF_16BE)							writeVTD(								temp_offset,								8,								TOKEN_DEC_ATTR_NAME,								depth);						else							writeVTD(								temp_offset >> 1,								8,								TOKEN_DEC_ATTR_NAME,								depth);					} else						throw new ParseException(							"XML decl error: Invalid char"								+ formatLineNumber());					ch_temp = getCharAfterS();					if (ch_temp != '"' && ch_temp != '\'')						throw new ParseException(							"XML decl error: Invalid char to start attr name"								+ formatLineNumber());					temp_offset = offset;					ch = r.getChar();					switch (ch) {						case 'a' :						case 'A' :							if ((r.skipChar('s')								|| r.skipChar('S'))								&& (r.skipChar('c')									|| r.skipChar('C'))								&& (r.skipChar('i')									|| r.skipChar('I'))								&& (r.skipChar('i')									|| r.skipChar('I'))								&& r.skipChar(ch_temp)) {																				if (encoding != FORMAT_UTF_16LE									&& encoding										!= FORMAT_UTF_16BE) {									if (must_utf_8)										throw new EncodingException("Can't switch from UTF-8"												+ formatLineNumber());									encoding = FORMAT_ASCII;									r = new ASCIIReader();									/*System.out.println(									    " " + (temp_offset) + " " + 5 + " dec attr val (encoding) " + depth);*/									if (encoding										< FORMAT_UTF_16BE)										writeVTD(											temp_offset,											5,											TOKEN_DEC_ATTR_VAL,											depth);									else										writeVTD(											temp_offset >> 1,											5,											TOKEN_DEC_ATTR_VAL,											depth);									break;								} else									throw new ParseException(										"XML decl error: Can't switch encoding to ASCII"											+ formatLineNumber());							}							throw new ParseException(								"XML decl error: Invalid Encoding"									+ formatLineNumber());						case 'i' :						case 'I' :							if ((r.skipChar('s')								|| r.skipChar('S'))								&& (r.skipChar('o')									|| r.skipChar('O'))								&& r.skipChar('-')								&& r.skipChar('8')								&& r.skipChar('8')								&& r.skipChar('5')								&& r.skipChar('9')								&& r.skipChar('-')								&& r.skipChar('1')								&& r.skipChar(ch_temp)) {								if (encoding != FORMAT_UTF_16LE									&& encoding										!= FORMAT_UTF_16BE) {									if (must_utf_8)										throw new EncodingException("Can't switch from UTF-8"												+ formatLineNumber());									encoding = FORMAT_ISO_8859;									r = new ISO8859Reader();									/*System.out.println(									    " " + (temp_offset) + " " + 10 + " dec attr val (encoding) " + depth);*/									if (encoding										< FORMAT_UTF_16BE)										writeVTD(											temp_offset,											10,											TOKEN_DEC_ATTR_VAL,											depth);									else										writeVTD(											temp_offset >> 1,											10,											TOKEN_DEC_ATTR_VAL,											depth);									break;								} else									throw new ParseException(										"XML decl error: Can't switch encoding to ISO-8859"											+ formatLineNumber());							}							throw new ParseException(								"XML decl error: Invalid Encoding"									+ formatLineNumber());						case 'u' :						case 'U' :							if ((r.skipChar('s')								|| r.skipChar('S')))								if (r.skipChar('-')									&& (r.skipChar('a')										|| r.skipChar('A'))									&& (r.skipChar('s')										|| r.skipChar('S'))									&& (r.skipChar('c')										|| r.skipChar('C'))									&& (r.skipChar('i')										|| r.skipChar('I'))									&& (r.skipChar('i')										|| r.skipChar('I'))									&& r.skipChar(ch_temp)) {									if (encoding										!= FORMAT_UTF_16LE										&& encoding											!= FORMAT_UTF_16BE) {										if (must_utf_8)											throw new EncodingException("Can't switch from UTF-8"													+ formatLineNumber());										encoding = FORMAT_ASCII;										r = new ASCIIReader();										//System.out.println(										//    " " + (temp_offset) + " " + 5 + " dec attr val (encoding) " + depth);										if (encoding											< FORMAT_UTF_16BE)											writeVTD(												temp_offset,												5,												TOKEN_DEC_ATTR_VAL,												depth);										else											writeVTD(												temp_offset													>> 1,												5,												TOKEN_DEC_ATTR_VAL,												depth);										break;									} else										throw new ParseException(											"XML decl error: Can't switch encoding to US-ASCII"												+ formatLineNumber());								} else									throw new ParseException(										"XML decl error: Invalid Encoding"											+ formatLineNumber());							if ((r.skipChar('t')								|| r.skipChar('T'))								&& (r.skipChar('f')									|| r.skipChar('F'))								&& r.skipChar('-')) {								if (r.skipChar('8')									&& r.skipChar(ch_temp)) {									if (encoding										!= FORMAT_UTF_16LE										&& encoding											!= FORMAT_UTF_16BE) {										//encoding = FORMAT_UTF8;										/*System.out.println(										    " " + (temp_offset) + " " + 5 + " dec attr val (encoding) " + depth);*/										if (encoding											< FORMAT_UTF_16BE)											writeVTD(												temp_offset,												5,												TOKEN_DEC_ATTR_VAL,												depth);										else											writeVTD(												temp_offset													>> 1,												5,												TOKEN_DEC_ATTR_VAL,												depth);										break;									} else										throw new ParseException(											"XML decl error: Can't switch encoding to UTF-8"												+ formatLineNumber());								}								if (r.skipChar('1')									&& r.skipChar('6')) {									if (r.skipChar(ch_temp)) {										if (encoding											== FORMAT_UTF_16LE											|| encoding												== FORMAT_UTF_16BE) {											if (!BOM_detected)												throw new EncodingException("BOM not detected for UTF-16"														+ formatLineNumber());											if (encoding												< FORMAT_UTF_16BE)												writeVTD(													temp_offset,													6,													TOKEN_DEC_ATTR_VAL,													depth);											else												writeVTD(													temp_offset														>> 1,													6,													TOKEN_DEC_ATTR_VAL,													depth);											break;										}										throw new ParseException(											"XML decl error: Can't switch encoding to UTF-16"												+ formatLineNumber());									} else if (										(r.skipChar('l')											|| r.skipChar('L'))											&& (r.skipChar('e')												|| r.skipChar('E'))											&& r.skipChar(ch_temp)) {										if (encoding											== FORMAT_UTF_16LE) {											/*System.out.println(											    " " + (temp_offset) + " " + 7 + " dec attr val (encoding) " + depth);*/											if (encoding												< FORMAT_UTF_16BE)												writeVTD(													temp_offset,													7,													TOKEN_DEC_ATTR_VAL,													depth);											else												writeVTD(													temp_offset														>> 1,													7,													TOKEN_DEC_ATTR_VAL,													depth);											break;										}										throw new ParseException(											"XML del error: Can't switch encoding to UTF-16LE"												+ formatLineNumber());									} else if (										(r.skipChar('b')											|| r.skipChar('B'))											&& (r.skipChar('e')												|| r.skipChar('E'))											&& r.skipChar(ch_temp)) {										if (encoding											== FORMAT_UTF_16BE) {											/*System.out.println(											    " " + (temp_offset) + " " + 7 + " dec attr val (encoding) " + depth);*/											if (encoding												< FORMAT_UTF_16BE)												writeVTD(													temp_offset,													7,													TOKEN_DEC_ATTR_VAL,													depth);											else												writeVTD(													temp_offset														>> 1,													7,													TOKEN_DEC_ATTR_VAL,													depth);											break;										}										throw new ParseException(											"XML del error: Can't swtich encoding to UTF-16BE"												+ formatLineNumber());									}									throw new ParseException(										"XML decl error: Invalid encoding"											+ formatLineNumber());								}							}						default :							throw new ParseException(								"XML decl Error: invalid encoding"									+ formatLineNumber());					}					ch = r.getChar();					if (XMLChar.isSpaceChar(ch))						ch = getCharAfterS();					temp_offset = offset - increment;				} else					throw new ParseException(						"XML decl Error: Invalid char"							+ formatLineNumber());			}			if (ch == 's') {				if (r.skipChar('t')					&& r.skipChar('a')					&& r.skipChar('n')					&& r.skipChar('d')					&& r.skipChar('a')					&& r.skipChar('l')					&& r.skipChar('o')					&& r.skipChar('n')					&& r.skipChar('e')) {					ch = getCharAfterS();					if (ch != '=')						throw new ParseException(							"XML decl error: Invalid char"								+ formatLineNumber());					/*System.out.println(					    " " + temp_offset + " " + 3 + " dec attr name (standalone) " + depth);*/					if (encoding < FORMAT_UTF_16BE)						writeVTD(							temp_offset,							10,							TOKEN_DEC_ATTR_NAME,							depth);					else						writeVTD(							temp_offset >> 1,							10,							TOKEN_DEC_ATTR_NAME,							depth);					ch_temp = getCharAfterS();					temp_offset = offset;					if (ch_temp != '"' && ch_temp != '\'')						throw new ParseException(							"XML decl error: Invalid char to start attr name"								+ formatLineNumber());					ch = r.getChar();					if (ch == 'y') {						if (r.skipChar('e')							&& r.skipChar('s')							&& r.skipChar(ch_temp)) {							/*System.out.println(							    " " + (temp_offset) + " " + 3 + " dec attr val (standalone) " + depth);*/							if (encoding < FORMAT_UTF_16BE)								writeVTD(									temp_offset,									3,									TOKEN_DEC_ATTR_VAL,									depth);							else								writeVTD(									temp_offset >> 1,									3,									TOKEN_DEC_ATTR_VAL,									depth);						} else							throw new ParseException(								"XML decl error: invalid val for standalone"									+ formatLineNumber());					} else if (ch == 'n') {						if (r.skipChar('o')							&& r.skipChar(ch_temp)) {							/*System.out.println(							    " " + (temp_offset) + " " + 2 + " dec attr val (standalone)" + depth);*/							if (encoding < FORMAT_UTF_16BE)								writeVTD(									temp_offset,									2,									TOKEN_DEC_ATTR_VAL,									depth);							else								writeVTD(									temp_offset >> 1,									2,									TOKEN_DEC_ATTR_VAL,									depth);						} else							throw new ParseException(								"XML decl error: invalid val for standalone"									+ formatLineNumber());					} else						throw new ParseException(							"XML decl error: invalid val for standalone"								+ formatLineNumber());				} else					throw new ParseException(						"XML decl error" + formatLineNumber());				ch = r.getChar();				if (XMLChar.isSpaceChar(ch))					ch = getCharAfterS();			}		}		if (ch == '?' && r.skipChar('>')) {			temp_offset = offset;			ch = getCharAfterS();			if (ch == '<') {				parser_state = STATE_LT_SEEN;			} else				throw new ParseException(					"Other Error: Invalid Char in XML"						+ formatLineNumber());		} else			throw new ParseException(				"XML decl Error: Invalid termination sequence"					+ formatLineNumber());		return parser_state;	}