当前位置: 技术问答>java相关
java.net.MalformedURLException: no protocol: links.xml
来源: 互联网 发布时间:2015-05-29
本文导语: 我编了一个javabean实现从xml文件中读内容: 源码如下: package xmlwriter; import javax.xml.parsers.*; import org.w3c.dom.*; public class xmldisplay { public static void main(String args[]){ try{ DocumentBuilderFactory factory = DocumentBu...
我编了一个javabean实现从xml文件中读内容:
源码如下:
package xmlwriter;
import javax.xml.parsers.*;
import org.w3c.dom.*;
public class xmldisplay {
public static void main(String args[]){
try{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder=factory.newDocumentBuilder();
Document doc=builder.parse("links.xml");
//doc.normalize();
NodeList links =doc.getElementsByTagName("link");
for (int i=0;i
源码如下:
package xmlwriter;
import javax.xml.parsers.*;
import org.w3c.dom.*;
public class xmldisplay {
public static void main(String args[]){
try{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder=factory.newDocumentBuilder();
Document doc=builder.parse("links.xml");
//doc.normalize();
NodeList links =doc.getElementsByTagName("link");
for (int i=0;i