DOM Nodes with empty TEXT NODE

Posted in C/C++ LANGUAGE, PROGRAMMING by edeguzman on February 13, 2012

In most cases DOM nodes can probably contain empty TEXT nodes for the reason that you read from file and tabs or spaces are being preserved in element nodes. This empty TEXT nodes sometimes a troublesome whenever you have an operation like you want to traverse to each child element nodes and do some process but suddenly the traversing to child nodes stop because of this empty TEXT node.

 I tried to google around to find a faster why to remove this empty TEXT nodes because I was hoping that there’s just an API call in DOM object that will automatically remove all empty TEXT nodes without affecting the child element nodes. I saw a lot of people encounter the same issue but provided complicate solution like using XSL. Then I decided to code it myself,  I was able to code it in 15 minutes in C++,  and I was googling around for about 1.5 hours 😦   Now after awhile I work on the servlet side then I’d encountered the same dilemma this time in Java.  This is the reason why I decided to share part of my code, just in case if someone might stumble in this dilemma.

Read more about this article in the below URL.






Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: