> <Root>
> <FirstElement>Value</FirstElement>
> </Root>
>
> My DOM tree will look like:
>
> + ELEMENT: Root
> + #TEXT:
> + ELEMENT: FirstElement
> + #TEXT: Value
> + #TEXT:

That is correct. Xerces, and the DOM specification, make no assumptions regarding whether your particular application considers the whitespace to be meaningful or not -- some do, so the parser must present this node unless you have in some way explicitly told it otherwise (by providing a DTD or schema which says that character data is not considered meaningful at this point, *and* by telling the parser that it may suppress whitespace in the "element content" context).

(The sax equivalent is the "ignorable whitespace" concept -- which is a misnomer, but which is intended to convey the same distinction of whitespace-in-element-content.)

Reply via email to