8081392: getNodeValue should return 'null' value for Element nodes

Reviewed-by: joehw
This commit is contained in:
Aleksei Efimov 2015-05-29 12:28:40 +03:00
parent 63dc40184a
commit 38bcbb873f
3 changed files with 3 additions and 7 deletions

View File

@ -2116,7 +2116,7 @@ public class DTMNodeProxy
*/
@Override
public String getTextContent() throws DOMException {
return getNodeValue(); // overriden in some subclasses
return dtm.getStringValue(node).toString();
}
/**

View File

@ -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;

View File

@ -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()+"]";
}
}