8081392: getNodeValue should return 'null' value for Element nodes
Reviewed-by: joehw
This commit is contained in:
parent
63dc40184a
commit
38bcbb873f
@ -2116,7 +2116,7 @@ public class DTMNodeProxy
|
||||
*/
|
||||
@Override
|
||||
public String getTextContent() throws DOMException {
|
||||
return getNodeValue(); // overriden in some subclasses
|
||||
return dtm.getStringValue(node).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3145,11 +3145,7 @@ public class SAX2DTM2 extends SAX2DTM
|
||||
m_data.elementAt(-dataIndex+1));
|
||||
}
|
||||
}
|
||||
else if (DTM.ELEMENT_NODE == type)
|
||||
{
|
||||
return getStringValueX(nodeHandle);
|
||||
}
|
||||
else if (DTM.DOCUMENT_FRAGMENT_NODE == type
|
||||
else if (DTM.ELEMENT_NODE == type || DTM.DOCUMENT_FRAGMENT_NODE == type
|
||||
|| DTM.DOCUMENT_NODE == type)
|
||||
{
|
||||
return null;
|
||||
|
@ -30,6 +30,6 @@ public class DocumentExtFunc {
|
||||
|
||||
public static String test(NodeList list) {
|
||||
Node node = list.item(0);
|
||||
return "["+node.getNodeName() + ":" + node.getNodeValue()+"]";
|
||||
return "["+node.getNodeName() + ":" + node.getTextContent()+"]";
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user