I assume you're talking about a DOM document that is created. The answer is no. If you do not have a grammer (DTD or Schema) which defines which whitespace is ignorable and which is important, then the parser must assume by the XML spec. that all whitespace is important.
I've run into this problem myself on a few occasions. If you simply want to strip out the empty text nodes throughout the entire document (including possibly valid whitespace nodes), then it's fairly simple to write a function to traverse the DOM tree and remove the unwanted nodes. (Bear in mind that you should not remove nodes WHILE traversing the tree as that changes the structure of the tree you're traversing and this is bad.) If you have a DTD or Schema you can set the parser feature: http://apache.org/xml/dom/features/include-ignorable-whitespace to 'false' and then on the input parse, the ignorable whitespace will not appear in your DOM. Brion Swanson -----Original Message----- From: Uma Shinde [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 06, 2001 12:18 PM To: Xerces-J-User (E-mail) Subject: Is there a way to avoid Empty text nodes for <CR> I'm using a non-validating parser and notice the empty text nodes get added in my parsed document for carriage returns following an Element node in my XML document, even when there's no text following it. Is there a way to avoid having these text nodes in a non-validating mode? -U --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
