Fight With Me!!!

导航

saxReader的列子

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;


public class ImportTemplateSaxHandler   extends  DefaultHandler{
	
	protected static final Logger logger = LoggerFactory.getLogger(ImportTemplateSaxHandler.class);
	
	@Override
	public void startDocument() throws SAXException {
		logger.info("test");
	}
	
	@Override
	public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
		// no op
		logger.info(localName);
		logger.info(qName);
		if("Styles".equals(qName)) {
			
		}
	}
	
	@Override
	public void endElement(String uri, String localName, String qName) throws SAXException {
		// no op
	}
}

 

posted on 2016-03-23 08:54  nickTimer  阅读(284)  评论(0编辑  收藏  举报