Online Test Banks
Score higher
See Online Test Banks
eLearning
Learning anything is easy
Browse Online Courses
Mobile Apps
Learning on the go
Explore Mobile Apps
Dummies Store
Shop for books and more
Start Shopping

Valid Versus a Well-Formed XML Document

Part of the XML For Dummies Cheat Sheet

In XML, a valid document must conform to the rules in its DTD (Document Type Definition) or schema, which defines what elements can appear in the document and how elements may nest within one another. If a document isn’t well-formed it doesn’t go far in the XML world so you need to play by some very basic rules when creating an XML document. A well-formed document must have these components:

  • All beginning and ending tags match up. In other words, opening and closing parts must always contain the same name in the same case: <tag> . . . </tag> or <TAG> . . . </TAG>, but not <tag> . . . </TAG>.

  • Empty elements follow special XML syntax, for example, <empty_element/>.

  • All attribute values occur within single or double quotation marks: <element id="value"> or <element id='value'>.

blog comments powered by Disqus

SERIES
XML For Dummies Cheat Sheet

Advertisement

Inside Dummies.com

Dummies.com Sweepstakes

Win $500. Easy.