@Test public void testPrologInsideElement() { scanner = XMLScanner.createScanner("<a><?xml version=\"1.0\" encoding=\"UTF-8\"?></a>"); assertOffsetAndToken(0, TokenType.StartTagOpen); assertOffsetAndToken(1, TokenType.StartTag); assertOffsetAndToken(2, TokenType.StartTagClose); assertOffsetAndToken(0 + 3, TokenType.StartPrologOrPI); assertOffsetAndToken(2 + 3, TokenType.PrologName, "xml"); assertOffsetAndToken(5 + 3, TokenType.Whitespace); assertOffsetAndToken(6 + 3, TokenType.AttributeName); assertOffsetAndToken(13 + 3, TokenType.DelimiterAssign); assertOffsetAndToken(14 + 3, TokenType.AttributeValue); assertOffsetAndToken(19 + 3, TokenType.Whitespace); assertOffsetAndToken(20 + 3, TokenType.AttributeName); assertOffsetAndToken(28 + 3, TokenType.DelimiterAssign); assertOffsetAndToken(29 + 3, TokenType.AttributeValue); assertOffsetAndToken(36 + 3, TokenType.PrologEnd); assertOffsetAndToken(41, TokenType.EndTagOpen); assertOffsetAndToken(43, TokenType.EndTag); assertOffsetAndToken(44, TokenType.EndTagClose); }
public static Scanner createScanner(String input) { return createScanner(input, false); }
XMLScanner implements Scanner { public static Scanner createScanner(String input) { return createScanner(input, false); } }
XMLScanner implements Scanner { public static Scanner createScanner(String input) { return createScanner(input, false); } XMLScanner(String input, int initialOffset, ScannerState initialState, boolean isDTDFile); }
XMLScanner implements Scanner { public static Scanner createScanner(String input) { return createScanner(input, false); } XMLScanner(String input, int initialOffset, ScannerState initialState, boolean isDTDFile); @Override TokenType scan(); int getLastNonWhitespaceOffset(); @Override TokenType getTokenType(); @Override /** * Starting offset position of the current token * * @return Starting offset position of the current token */ int getTokenOffset(); @Override int getTokenLength(); @Override /** * Ending offset position of the current token * * @return Ending offset position of the current token */ int getTokenEnd(); @Override String getTokenText(); @Override ScannerState getScannerState(); @Override String getTokenError(); String getTokenTextFromOffset(int offset); static Scanner createScanner(String input); static Scanner createScanner(String input, boolean isDTD); static Scanner createScanner(String input, int initialOffset); static Scanner createScanner(String input, int initialOffset, boolean isDTDFile); static Scanner createScanner(String input, int initialOffset, ScannerState initialState); static Scanner createScanner(String input, int initialOffset, ScannerState initialState, boolean isDTDFile); }
XMLScanner implements Scanner { public static Scanner createScanner(String input) { return createScanner(input, false); } XMLScanner(String input, int initialOffset, ScannerState initialState, boolean isDTDFile); @Override TokenType scan(); int getLastNonWhitespaceOffset(); @Override TokenType getTokenType(); @Override /** * Starting offset position of the current token * * @return Starting offset position of the current token */ int getTokenOffset(); @Override int getTokenLength(); @Override /** * Ending offset position of the current token * * @return Ending offset position of the current token */ int getTokenEnd(); @Override String getTokenText(); @Override ScannerState getScannerState(); @Override String getTokenError(); String getTokenTextFromOffset(int offset); static Scanner createScanner(String input); static Scanner createScanner(String input, boolean isDTD); static Scanner createScanner(String input, int initialOffset); static Scanner createScanner(String input, int initialOffset, boolean isDTDFile); static Scanner createScanner(String input, int initialOffset, ScannerState initialState); static Scanner createScanner(String input, int initialOffset, ScannerState initialState, boolean isDTDFile);  }