O'Reilly logo

PHP Programming with PEAR by Stoyan Stefanov, Carsten Lucke

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

Creating XML Documents

At first glance, creating XML documents seems to be extremely easy. After all, a document only consists of tags in plain text, so it is nothing more than an HTML document and you should be able to use concatenation or PHP's string functions for this task. However, there are some points that are often overlooked when creating XML and which can haunt you as a developer if your application is used in production. These points are closely related to the rules that any XML document must follow:

  • XML is (in contrast to HTML) case sensitive;<foo/> is not equivalent to<Foo/>.
  • Every XML tag must be closed. If the tag contains no data, the closing tag may be omitted and the tag can be written as an empty element tag. That means you have ...

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