private final int handleEq(String attr) throws IOException, WstxException { int c = getNextAfterWs(false); if (c != '=') { reportUnexpectedChar(c, ERR_XMLDECL_EXP_EQ+"'"+attr+"'"); } c = getNextAfterWs(false); if (c != '"' && c != '\'') { reportUnexpectedChar(c, ERR_XMLDECL_EXP_ATTRVAL+"'"+attr+"'"); } return c; }
private final String readXmlEncoding() throws IOException, WstxException { int c = checkKeyword(XmlConsts.XML_DECL_KW_ENCODING); if (c != CHAR_NULL) { reportUnexpectedChar(c, XmlConsts.XML_DECL_KW_ENCODING); } c = handleEq(XmlConsts.XML_DECL_KW_ENCODING); int len = readQuotedValue(mKeyword, c); /* Hmmh. How about "too long" encodings? Maybe just truncate them, * for now? */ if (len == 0) { // let's still detect missing value... reportPseudoAttrProblem(XmlConsts.XML_DECL_KW_ENCODING, null, null, null); } if (len < 0) { // will be truncated... return new String(mKeyword); } return new String(mKeyword, 0, len); }
reportUnexpectedChar(c, XmlConsts.XML_DECL_KW_STANDALONE);
/** * Method that should get next character, which has to be either specified * character (usually end marker), OR, any character as long as there' * at least one space character before it. */ private final int getWsOrChar(int ok) throws IOException, WstxException { int c = getNext(); if (c == ok) { return c; } if (c > CHAR_SPACE) { reportUnexpectedChar(c, "; expected either '"+((char) ok)+"' or white space"); } if (c == CHAR_LF || c == CHAR_CR) { // Need to push it back to be processed properly pushback(); } return getNextAfterWs(false); }
reportUnexpectedChar(c, XmlConsts.XML_DECL_KW_VERSION);
reportUnexpectedChar(c, ERR_XMLDECL_KW_VERSION); reportUnexpectedChar(c, ERR_XMLDECL_KW_ENCODING); reportUnexpectedChar(c, ERR_XMLDECL_END_MARKER); reportUnexpectedChar(c, ERR_XMLDECL_END_MARKER);
private final int handleEq(String attr) throws IOException, WstxException { int c = getNextAfterWs(false); if (c != '=') { reportUnexpectedChar(c, ERR_XMLDECL_EXP_EQ+"'"+attr+"'"); } c = getNextAfterWs(false); if (c != '"' && c != '\'') { reportUnexpectedChar(c, ERR_XMLDECL_EXP_ATTRVAL+"'"+attr+"'"); } return c; }
private final int handleEq(String attr) throws IOException, WstxException { int c = getNextAfterWs(false); if (c != '=') { reportUnexpectedChar(c, ERR_XMLDECL_EXP_EQ+"'"+attr+"'"); } c = getNextAfterWs(false); if (c != '"' && c != '\'') { reportUnexpectedChar(c, ERR_XMLDECL_EXP_ATTRVAL+"'"+attr+"'"); } return c; }
private final int handleEq(String attr) throws IOException, WstxException { int c = getNextAfterWs(false); if (c != '=') { reportUnexpectedChar(c, ERR_XMLDECL_EXP_EQ+"'"+attr+"'"); } c = getNextAfterWs(false); if (c != '"' && c != '\'') { reportUnexpectedChar(c, ERR_XMLDECL_EXP_ATTRVAL+"'"+attr+"'"); } return c; }
private final int handleEq(String attr) throws IOException, WstxException { int c = getNextAfterWs(false); if (c != '=') { reportUnexpectedChar(c, ERR_XMLDECL_EXP_EQ+"'"+attr+"'"); } c = getNextAfterWs(false); if (c != '"' && c != '\'') { reportUnexpectedChar(c, ERR_XMLDECL_EXP_ATTRVAL+"'"+attr+"'"); } return c; }
private final int handleEq(String attr) throws IOException, WstxException { int c = getNextAfterWs(false); if (c != '=') { reportUnexpectedChar(c, ERR_XMLDECL_EXP_EQ+"'"+attr+"'"); } c = getNextAfterWs(false); if (c != '"' && c != '\'') { reportUnexpectedChar(c, ERR_XMLDECL_EXP_ATTRVAL+"'"+attr+"'"); } return c; }
private final int handleEq(String attr) throws IOException, WstxException { int c = getNextAfterWs(false); if (c != '=') { reportUnexpectedChar(c, ERR_XMLDECL_EXP_EQ+"'"+attr+"'"); } c = getNextAfterWs(false); if (c != '"' && c != '\'') { reportUnexpectedChar(c, ERR_XMLDECL_EXP_ATTRVAL+"'"+attr+"'"); } return c; }
private final int handleEq(String attr) throws IOException, WstxException { int c = getNextAfterWs(false); if (c != '=') { reportUnexpectedChar(c, ERR_XMLDECL_EXP_EQ+"'"+attr+"'"); } c = getNextAfterWs(false); if (c != '"' && c != '\'') { reportUnexpectedChar(c, ERR_XMLDECL_EXP_ATTRVAL+"'"+attr+"'"); } return c; }
private final String readXmlEncoding() throws IOException, WstxException { int c = checkKeyword(XmlConsts.XML_DECL_KW_ENCODING); if (c != CHAR_NULL) { reportUnexpectedChar(c, XmlConsts.XML_DECL_KW_ENCODING); } c = handleEq(XmlConsts.XML_DECL_KW_ENCODING); int len = readQuotedValue(mKeyword, c); /* Hmmh. How about "too long" encodings? Maybe just truncate them, * for now? */ if (len == 0) { // let's still detect missing value... reportPseudoAttrProblem(XmlConsts.XML_DECL_KW_ENCODING, null, null, null); } if (len < 0) { // will be truncated... return new String(mKeyword); } return new String(mKeyword, 0, len); }
private final String readXmlEncoding() throws IOException, WstxException { int c = checkKeyword(XmlConsts.XML_DECL_KW_ENCODING); if (c != CHAR_NULL) { reportUnexpectedChar(c, XmlConsts.XML_DECL_KW_ENCODING); } c = handleEq(XmlConsts.XML_DECL_KW_ENCODING); int len = readQuotedValue(mKeyword, c); /* Hmmh. How about "too long" encodings? Maybe just truncate them, * for now? */ if (len == 0) { // let's still detect missing value... reportPseudoAttrProblem(XmlConsts.XML_DECL_KW_ENCODING, null, null, null); } if (len < 0) { // will be truncated... return new String(mKeyword); } return new String(mKeyword, 0, len); }
private final String readXmlEncoding() throws IOException, WstxException { int c = checkKeyword(XmlConsts.XML_DECL_KW_ENCODING); if (c != CHAR_NULL) { reportUnexpectedChar(c, XmlConsts.XML_DECL_KW_ENCODING); } c = handleEq(XmlConsts.XML_DECL_KW_ENCODING); int len = readQuotedValue(mKeyword, c); /* Hmmh. How about "too long" encodings? Maybe just truncate them, * for now? */ if (len == 0) { // let's still detect missing value... reportPseudoAttrProblem(XmlConsts.XML_DECL_KW_ENCODING, null, null, null); } if (len < 0) { // will be truncated... return new String(mKeyword); } return new String(mKeyword, 0, len); }
private final String readXmlEncoding() throws IOException, WstxException { int c = checkKeyword(XmlConsts.XML_DECL_KW_ENCODING); if (c != CHAR_NULL) { reportUnexpectedChar(c, XmlConsts.XML_DECL_KW_ENCODING); } c = handleEq(XmlConsts.XML_DECL_KW_ENCODING); int len = readQuotedValue(mKeyword, c); /* Hmmh. How about "too long" encodings? Maybe just truncate them, * for now? */ if (len == 0) { // let's still detect missing value... reportPseudoAttrProblem(XmlConsts.XML_DECL_KW_ENCODING, null, null, null); } if (len < 0) { // will be truncated... return new String(mKeyword); } return new String(mKeyword, 0, len); }
private final String readXmlEncoding() throws IOException, WstxException { int c = checkKeyword(XmlConsts.XML_DECL_KW_ENCODING); if (c != CHAR_NULL) { reportUnexpectedChar(c, XmlConsts.XML_DECL_KW_ENCODING); } c = handleEq(XmlConsts.XML_DECL_KW_ENCODING); int len = readQuotedValue(mKeyword, c); /* Hmmh. How about "too long" encodings? Maybe just truncate them, * for now? */ if (len == 0) { // let's still detect missing value... reportPseudoAttrProblem(XmlConsts.XML_DECL_KW_ENCODING, null, null, null); } if (len < 0) { // will be truncated... return new String(mKeyword); } return new String(mKeyword, 0, len); }
/** * Method that should get next character, which has to be either specified * character (usually end marker), OR, any character as long as there' * at least one space character before it. */ private final int getWsOrChar(int ok) throws IOException, WstxException { int c = getNext(); if (c == ok) { return c; } if (c > CHAR_SPACE) { reportUnexpectedChar(c, "; expected either '"+((char) ok)+"' or white space"); } if (c == CHAR_LF || c == CHAR_CR) { // Need to push it back to be processed properly pushback(); } return getNextAfterWs(false); }
/** * Method that should get next character, which has to be either specified * character (usually end marker), OR, any character as long as there' * at least one space character before it. */ private final int getWsOrChar(int ok) throws IOException, WstxException { int c = getNext(); if (c == ok) { return c; } if (c > CHAR_SPACE) { reportUnexpectedChar(c, "; expected either '"+((char) ok)+"' or white space"); } if (c == CHAR_LF || c == CHAR_CR) { // Need to push it back to be processed properly pushback(); } return getNextAfterWs(false); }