dibanu
asked on
How to get Blank tags from XML using Oracle DOM Parser
I am using Oracle DOM Parser to parser my XML.
I need to find out which tags are BLANK in the XML and then differ the processing for such tags . CAn anybody help
I need to find out which tags are BLANK in the XML and then differ the processing for such tags . CAn anybody help
Not sure if i understand that code example although i think
>>if (eachItem.getNodeValue().t rim().leng th>0) {
should be
if (eachItem.getNodeValue().t rim().leng th()>0) {
You may want to add the blank nodes to a List so you know which ones to avoid
>>if (eachItem.getNodeValue().t
should be
if (eachItem.getNodeValue().t
You may want to add the blank nodes to a List so you know which ones to avoid
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
For nodes that only contain whitespace:
isBlank=true;
NodeList nl=node.getChildNodes();
for(int i=0;i<nl.getLength();i++) {
Node eachItem=nl.item(i);
if (!eachItem instanceof TextElement) {
isBlank=false;
break;
} else {
if (eachItem.getNodeValue().t
isBlank=false;
break;
}
}
}