快捷搜索:  as  2018  FtCWSyGV  С˵  test  xxx  Ψһ  w3viyKQx

beat365亚洲官方网站:SAX解析XML



package simpleTest;

import org.xml.sax.Attributes;

import org.xml.sax.SAXException;

import org.xml.sax.Locatobeat365亚洲官方网站r;

import org.xml.sax.ContentHandler;

import org.xml.sax.InputSource;

import org.xml.sax.helpers.DefaultHandler;

import java.io.IOException;

import javax.xml.parsers.SAXPabeat365亚洲官方网站rser;

import javax.xml.parsers.SAXParserFactory;

class TestSAX extends DefaultHandler

{

private StringBuffer buf;

public TestSAX()

{

super();

}

public void setDocumentLocator(Locator locator)

{

}

public void startDocument() throws SAXException

{

buf=new StringBuffer();

System.out.println("奸淫奸淫*开始解析文档奸淫奸淫*");

}

public void endDocument() throws SAXException

{

Systembeat365亚洲官方网站.out.println("奸淫奸淫*文档解析停止奸淫奸淫*");

}

public void startPrefixMapping( String prefix, String uri )

{

System.out.println("

前缀映射: " + prefix +" 开始!"+ "它的URI是:" + uri);

}

public void endPrefixMapping( String prefix )

{

System.out.println("

前缀映射: "+prefix+" 停止!");

}

public void processingInstruction( String target, String instruction )

throws SAXException

{

}

public void ignorableWhitespace( char[] chars, int start, int length ) throws SAXException

{

}

public void beat365亚洲官方网站skippedEntity( String name ) throws SAXException

{

}

public void startElement(String namespaceURI,String localName,String qName,Attributes atts)

{

System.outbeat365亚洲官方网站.println("奸淫奸淫*开始解析元素奸淫奸淫*");

System.out.println("元素名"+qName);

for(int i=0;i

王小明

信息学院

6258113

男,1955年生,博士,95年调入海南大年夜学

您可能还会对下面的文章感兴趣: