O'Reilly logo

Effective XML: 50 Specific Ways to Improve Your XML by Elliotte Rusty Harold

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Ignorable White Space

Another special case that really isn't all that special is white space in element content, sometimes misleadingly called ignorable white space. This is white space in an element whose element declaration specifies that it can contain only child elements and not PCDATA. For example, suppose the PhoneNumber element has the following declaration.

<!ELEMENT PhoneNumber (CountryCode, AreaCode, Number)>

Now consider the valid PhoneNumber element below.

<PhoneNumber>
  <CountryCode>01</CountryCode>
  <AreaCode>212</ AreaCode >
  <Number>555-1234</ Number >
</PhoneNumber>

Because the DTD says this element can only contain these three child elements, the white space is ignorable. It is assumed to exist only for formatting and not to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required