当前位置: 技术问答>java相关
请问我在jsp里要读取其它网站上的xml的内容应该如何处理?
来源: 互联网 发布时间:2015-03-17
本文导语: 本地文件可以通过以下程序来实现 SAXParser.parse(xmlFile,Hashtable) 那么远程的呢? | SAXParser: parse public void parse(java.lang.String uri, DefaultHandler dh) throws ...
本地文件可以通过以下程序来实现
SAXParser.parse(xmlFile,Hashtable)
那么远程的呢?
SAXParser.parse(xmlFile,Hashtable)
那么远程的呢?
|
SAXParser:
parse
public void parse(java.lang.String uri,
DefaultHandler dh)
throws SAXException,
java.io.IOException
Parse the content described by the giving Uniform Resource Identifier (URI) as XML using the specified DefaultHandler.
Parameters:
uri - The location of the content to be parsed.
dh - The SAX DefaultHandler to use.
Throws:
java.io.IOException - If any IO errors occur.
java.lang.IllegalArgumentException - If the uri is null.
SAXException - If the underlying parser throws a SAXException while parsing.
See Also:
DocumentHandler
parse
public void parse(java.lang.String uri,
DefaultHandler dh)
throws SAXException,
java.io.IOException
Parse the content described by the giving Uniform Resource Identifier (URI) as XML using the specified DefaultHandler.
Parameters:
uri - The location of the content to be parsed.
dh - The SAX DefaultHandler to use.
Throws:
java.io.IOException - If any IO errors occur.
java.lang.IllegalArgumentException - If the uri is null.
SAXException - If the underlying parser throws a SAXException while parsing.
See Also:
DocumentHandler
|
你可以先保存为FILE,好象还有其它的输入类,有FILE,URL 等等,看看API吧。
|
SAXReader(filename):local or remote.
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。