Mega Code Archive

 
Categories / XML Tutorial / Introduction
 

Whitespace in PCDATA

Whitespace includes the space character,  new lines, and tabs.  Whitespace is used to separate words to make text more readable.  In XML, no whitespace stripping takes place for PCDATA.  <Tag>This is a paragraph.  this is a test.</Tag>  the PCDATA is  This is a paragraph.  this is a test.  XML parsers change all new lines to a single linefeed character before processing.