Teacher | Production Issues | Server-Side Programming | Resources
XML
An Active Server Page Extensible Markup Language (XML) is the universal format for structured documents and data on the Web. It is a cousin of HTML that allows you to define your own mark-up formats when HTML is not a good fit. It is an application profile that enables generic information to be served, received, and processed on the Web to be used for data. XML has been designed for ease of use to support a wide variety of applications. XML, describes a class of data objects called XML documents which describe the behavior of computer programs which process them. XML documents are made up of storage units which contain either parsed or unparsed data. Parsed data is made up of characters, some of which form character data, and some of which form markup. Markup encodes a description of the document's storage layout and logical structure. XML provides a mechanism to impose constraints on the storage layout and logical structure. An XML processor is used to read XML documents and provide access to their content and structure.
In XML, tags can be invented that best describe the contents. With just a touch of coding, XML could pull the contents of a recipe into an appropriate database field, then output it to a hard copy. XML uses markup language that is readable by both humans and machines.
What is involved in coding XML
An XML file must meet two criteria: it has to be well formed and valid. A well-formed document is one that is both complete, reasonable and readable. The tags in an XML document look a lot like HTML, with, one important difference. There is no information to indicate how this data should be presented. Layout instructions, will come from elsewhere. It's the same principle behind putting your address book in fields and records of a database instead of a list in a word processor. The database gives you the ability to merge your addresses into labels, envelopes, letters, or whatever you want. Eventually, that's what you're going to do with this recipe file, merge it into a presentational language like HTML or CSS.An XML document must be well formed and follow three basic rules:
- The document starts with an XML declaration.
- There is a root element in which all others are contained.
- All elements must be properly nested. No overlapping is permitted.
XML Examples