首页 > 代码库 > Java解析HTML标签Tag

Java解析HTML标签Tag

import java.util.HashMap;
import java.util.Map;

public class TagParser {
	private Integer index = 0;
	private char[] tagChar;
	private int position = 0;
	/* 解析符号 */
	private char symbol = '"';
	public static final String START_SCRIPT = "<script";
	public static final String END_SCRIPT = ">";
	public static final String END_SCRIPT_1 = "/>";
	public static final String EQ = "=";
	public static final char SPACE = ' ';
	public static final String MUST_SPACE = " ";
	public static final String TAB = "	";
	public static final String SYMBOL = "'";
	private DFAStatus status;
	private Map<Integer, Entity> map = new HashMap<Integer, Entity>();
	private Map<String, String> result = new HashMap<String, String>();

	public static void main(String[] args) throws SymbolError {
		String tag = "<script filter=\"a\'\" type=\"text/javascript\" id='node' src=http://www.mamicode.com/"http://www.test.com/abc.js/" async=/"true/" />";>

Java解析HTML标签Tag