/** Advance the current position past any whitespace in the input */ protected void skipWhiteSpace () { while (pos < source.length () && charValidator.isWhitespace (source.charAt (pos))) pos ++; }
/** Read the name of an element. * * <p>The resulting token will contain the '<' plus any whitespace between * it and the name plus the name itself but no whitespace after the name. */ protected void parseBeginElement (Token token) { token.setType (Type.BEGIN_ELEMENT); inStartElement = true; skipWhiteSpace (); int nameStartOffset = pos; parseName ("start tag"); if (pos == nameStartOffset) throw new XMLParseException ("Missing element name", token); if (pos >= source.length ()) throw new XMLParseException ("Missing '>' of start tag", source, pos); char c = source.charAt (pos); if (!charValidator.isWhitespace (c) && c != '/' && c != '>') throw new XMLParseException ("Expected whitespace, '>' or '/>' after element name", source, pos); }