O'Reilly logo

PHP Advanced for the World Wide Web: Visual QuickPro Guide by Larry Ullman

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

XML Syntax

The primary thing you must understand before doing anything with XML is how XML documents themselves are structured. An XML document, which is just an organized text file, contains three parts:

  • The prolog or XML declaration

  • The document type declaration

  • The element(s)/content

The XML prolog (which is to say, prologue) is the first line of every XML file and should be in the form of

<?xml version="1.0"?> 

The next step, the document type declaration, is where you define your primary (or root) element.

<!DOCTYPE name 

...

>

This is similar to HTML documents that begin with <!DOCTYPE html, stating that the overarching element of the file is the html tag. Within the document type declaration, you can define your elements or you can reference ...

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