Re: Empty text node in DOM tree
stony_dreams <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Message-ID | <[email protected]> |
I was facing a similar problem with the empty text nodes in the DOM, but for
me it was a but simple as I was serializing the entire DOM and passing it
over to a Java backend over a socket. There I just did a regular expression
replacement:
domString = Pattern.compile("\\s+").matcher(domString).replaceAll(" ");
This removed all the text nodes having multiple \n and \t etc but it still
gives me some text nodes having some special characters in them and not just
whitespaces. I don't know what to do with these text nodes as they are not
even visible on the page... Could not find a generic function to replace all
these junk/control/invisible characters before the parsing too...
Boris Zbarsky wrote:
>
> [email protected] wrote:
>> Does Mozilla treat tags differently regarding the new line between
>> them?
>
> Yes.
>
>> Is there a specification for the parsing behavior?
>
> The HTML5 proposal is the closest to it, but we don't match it exactly.
> Or
> rather it doesn't match us exactly.
>
> -Boris
>
> _______________________________________________
> dev-tech-dom mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-tech-dom
>
>
--
View this message in context: http://www.nabble.com/Empty-text-node-in-DOM-tree-tp14737934p15092249.html
Sent from the Mozilla - DOM mailing list archive at Nabble.com.