Stripping leading and trailing spaces???

David Megginson david at
Wed Feb 3 00:42:17 GMT 1999

Dan Finkelstein writes:

 > It seems that leading and trailing spaces are being removed from
 > PCDATA before it is returned to me.  For example,
 > 	<text>  Hello there!  </text
 > comes back as "Hello there!" instead of " Hello there!  ".  I'm
 > using Sun's early release parser, and I'm wondering if this is
 > standard XML behavior? if there is a way to preverse the spaces?

Which interface are you using?  If you're using SAX, it could be that
the spaces are being delivered in separate characters() events
(parsers are allowed to chunk up character data any way they want).

All the best,


David Megginson                 david at

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as:
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list