> Date: Mon, 18 Feb 2002 13:23:22 -0600
> From: Hasan Al-Sheboul <[EMAIL PROTECTED]>
>
> for the following code (xerces2-J, DOM model)
>
> case Node.TEXT_NODE:
> String str = getNodeValue();
> if ( ( !str.equals("\n")) && (!str.equals(null)) ) {
> // do something
> }
>
> I'm trying to get rid of the empty text child nodes, like:
> <tag1>
> <tage2>
> TextB
> </tag2>
> </tag1>
>
> The above code returns back 3 children nodes for element <tag1>: TEXT
> (empty), ELEMENT (tag2), TEXT(empty).
>
> Can anyone help me out of how to get rid of the TEXT(empty) child nodes?
One simple way is to use a DTD which ways that tag1 has no PCDATA. Then
set the parser to not include ignorable white space.
--
Ken Goldman [EMAIL PROTECTED] 914-784-7646
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]