Java基础知识的三十个经典问答
throws SAXException
{
currentValue = new String(ch, start, length);
}
public void endElement(String name) throws SAXException
{
if (currentElement.equals(name))
table.put(currentElement, currentValue);
}
}
JSP内容显示源码,SaxXml.jsp:
< %@page errorPage=ErrPage.jsp contentType=text/html;charset=GB2312 %> >
< %@page import=java.io.*%>
< %@page import=java.util.Hashtable %>
< %@page import=org.w3c.dom.*% >
< %@page import=org.xml.sax.* %>
< %@page import=javax.xml.parsers.SAXParserFactory %>
< %@page import=javax.xml.parsers.SAXParser %>
< %@page import=SAXHandler %>
< %@
File file = new File(c:\people.xml);
FileReader reader = new FileReader(file);