Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a specification string or the string could not be parsed. 
build的URL路径中有中文字符可能不支持
看看能不能设置encoding来解决

解决方案 »

  1.   

    我试了下没异常了可是值出不来
    我的xml是这样的
     <?xml version="1.0" encoding="UTF-8" ?> 
    - <NewDataSet xmlns="xmlns://www.fortifysoftware.com/schema/fvdl">
      - <FVDL xmlns="xmlns://www.fortifysoftware.com/schema/fvdl"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.6" xsi:type="FVDL">
         <CreatedTS date="2008-08-24" time="10:41:13" /> 
          - <Build xmlns="xmlns://www.fortifysoftware.com/schema/fvdl">
               <BuildID>Sample1</BuildID> 
               <NumberFiles>1</NumberFiles> 
               <ScanTime value="6" /> 
           </Build>
    我现在想获得BuildID的内容(Sample1)上面程序如何改
    我是这样的没打印
    SAXBuilder sb = new SAXBuilder();
    try {
    Document doc=sb.build("G:\\Sample1.xml");
    Element root=doc.getRootElement();
    List l=root.getChildren("FVDL");
    for(int i=0;i<l.size();i++){
    Element e=(Element) l.get(i);

    System.out.print(e.getChild("//BuildID").getText())
      

  2.   

    我就是想问下NewDataSet是根元素还是FVDL是根元素 我刚才这个程序打印下显示l.size()的值是0 不懂?