Characteristics of XML Documents

An XML document must be well formed and valid. For a document to be well formed, it must contain a root element, which is unique and surrounds the whole document, and all other elements must be within the root element with no overlapping. There should be no unclosed tags. Every start tag must have an end tag. The address book example earlier is a well-formed document.

A valid document, on the other hand, must be not only well formed, but also have a DTD to which the well-formed document conforms. This means that the XML document must use only the elements that have been declared in the DTD.

Some advantages of XML technology are that it is platform and system independent; enables you to define your own tags; allows ...

Get Sams Teach Yourself EJB in 21 Days 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.