Include CDATA sections in getTextContent().

Fixes bug 217
This commit is contained in:
hns 2003-02-03 13:14:58 +00:00
parent f74c21d405
commit 2e239f797e

View file

@ -97,7 +97,8 @@ public class XmlUtil {
int ct = childlist.getLength(); int ct = childlist.getLength();
for ( int j=0; j<ct; j++ ) { for ( int j=0; j<ct; j++ ) {
org.w3c.dom.Node childNode = childlist.item(j); org.w3c.dom.Node childNode = childlist.item(j);
if ( childNode.getNodeType()==org.w3c.dom.Node.TEXT_NODE ) { if ( childNode.getNodeType() == Node.TEXT_NODE ||
childNode.getNodeType() == Node.CDATA_SECTION_NODE) {
childtext.append(childNode.getNodeValue().trim() ); childtext.append(childNode.getNodeValue().trim() );
} }
} }