<?xml   version="1.0"   encoding="UTF-8"?> 
      <test> 
          <dc:title> 标题 </dc:title> 
    </test> 
如何获取到dc:title的值“标题”? /test/dc:title   好像不行

解决方案 »

  1.   

    getChildText("dc:title");方法来取。使用jdom.jar来取。
      

  2.   

    我主要想问问怎么定位到这个节点
    如果
    <?xml       version="1.0"       encoding="UTF-8"?>   
             <test>   
                        <dc:title>   标题   </dc:title>   
            </test> 
            <test1>   
                        <dc:title>   标题1   </dc:title>   
            </test1>     有两个dc:title
    用getChildText("dc:title");肯定不行啊。