Tags and White Space

Inside tags the white space story is quite different. These three shape elements are the same for all intents and purposes.

<shape>star</shape>

<shape
            >star</shape>

<shape    >star</shape>

Parsers will not distinguish one from the other, and your code should not depend on the difference.

Similarly, white space in a document's prolog, epilog, and DTD is not considered. For example, these three documents are essentially the same.

 <?xml version="1.0"?> <?xml-stylesheet type="text/css" href="root.css"?> <!DOCTYPE root SYSTEM "data.dtd"> <root> contents </root> ____________________________________________________________ <?xml version="1.0"?> <?xml-stylesheet type="text/css" href="root.css"?> <!DOCTYPE root SYSTEM "data.dtd"> ...

Get Effective XML: 50 Specific Ways to Improve Your XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.