Whitespace is only "ignorable" if you're validating against a DTD or schema
which says that the element containing them does not accept text as
content. ("ignorable" is a bad term; the proper description is really
"character data in element content".) If you haven't validated, or if the
element was declared as having mixed content, the whitespace _is_ part of
the document's content.

You can also use the xml:space attribute to hint to an application that
whitespace can be ignored. But it has generally been considered the
application's responsibility to recognize and act on that hint; I'm not
sure whether Xerces offers a mode that allows it to perform this filtering
for you.

Note that in basic XML, whitespace adjacent to non-whitespace text content
is _always_ considered to be part of that text. Schemas have some datatypes
which say that whitespace should be reduced/discarded as part of the
process of producing a "normalized' representation of the data.

Sometimes the simplest answer is to remove unnecessary space from your XML
document, and generate a pretty formatted view only when a human wants to
read it.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to