在W3C。ORG。DOM包的DOCUMENT类中有这么一个方法:getNodeValue()
可以满足你的要求

解决方案 »

  1.   

    抱歉刚才记错了
    应该在这
    org.w3c.dom 
    Interface Node
    方法名称为:getNodeValue
    帮助信息为:
    public String getNodeValue()
                        throws DOMExceptionThe value of this node, depending on its type; see the table above. When it is defined to be null, setting it has no effect. Throws: 
    DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. 
    DOMException - DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString variable on the implementation
      

  2.   

    使用JDOM.
    Document doc = new Document( new Element("a") );
    String strValue = doc.getRootElement().getText();
      

  3.   

    123回被当做一个文本节点,是<a>的第一个子节点
    Text value = node.getFirstNode();  // 拿到
    String strValue = value.getData();  // 转换
    然后随便你怎麽样
      

  4.   

    使用DOM
    node 为包含该值的节点。
    String value=node.getFirstChild().getNodeValue())
      

  5.   

    大家说的我试了只有 Engineer_develop(***心里很烦***) 说的是正确的,直接用getNodeValue()得到的是null