What is XML?

Lets start by answering the most basic question: What is XML?

The World Wide Web Consortium (W3C) provides the following definition for XML in their glossary at www.w3.org/TR/DOM-Level-2-Core/glossary.html:

Extensible Markup Language (XML) is an extremely simple dialect of SGML. The goal is to enable generic SGML to be served , received, and processed on the Web in the way that is now possible with HTML. XML has been designed for ease of implementation and for interoperability with both SGML and HTML.

As you can see from this definition, its very difficult to explain XML in a single sentence or paragraph. To start with, XML stands for Extensible Markup Language . Extensible means that you can use XML to create your own languages. The term markup means that the languages you create use tags to surround or mark up text.

XML is not a markup language like HTML. It is a meta-language that you can use to create other markup languages. The languages that you create work with structured data, and you use XML to invent tags that describe your data and the data structures. You can use different tags each time you create an XML document, or you can use the same tags for different documents.

Groups have created their own languages based on XML. This allows them to share information specific to their industry or area of expertise using a common set of markup tags and structures.

One example, Chemical Markup Language (CML), allows scientists to share molecular information in a standardized way. There are specific rules for structuring CML documents and referring to molecular information. MathML is another example of a standard language using XML. XML documents can use MathML to describe mathematical operations.

Extensible HTML (XHTML) is an example that is probably more familiar to you. XHTML was created when HTML was rewritten according to XML rules.

Think about the tags you use in XHTML <p></p> , <h1></h1> . These tags mark up information on a web page, and you use them in a specific way, according to some predefined rules. For instance, one rule says that you cant include <p></p> tags in the <head> section of a web page.

Being familiar with these rules means that you can open any web page written in XHTML and understand the structure. It also means that any software package that knows the XHTML rules can display a web page.

By itself, XML doesnt do anything other than store information. Its not a programming language in its own right. XML documents need humans or software packages to process the information that they contain.

XML documents work best with structured information such as names and addresses, product catalogs, and lists of documentsanything with a standardized format. You can store hierarchical information within XML documents, a bit like storing information in a database. Instead of breaking the information into tables and fields, you use elements and tags to describe the data.

This concept is a little easier to explore with an example. Most of us have a phone book that we use to store contact information for our friends and colleagues. You probably have the information in a software package like Microsoft Outlook or Outlook Express.

Your phone book contains many different names but you store the same information about each contact their name , phone number, and address. The way the information is stored depends on the software package youve chosen . If the manufacturer changed the package or discontinued it, youd have to find a new way to store information about your contacts.

Transferring the information to a new software program is likely to be difficult. Youd have to export it from the first package, rearrange the contents to suit the second package, and then import the data. Most software applications dont share a standard format for contact data, although some can talk to each other. You have to rely on the standards created by each company.

As an alternative, you can use XML to store the information. You create your own tag names to describe the data; tags like <contact> , <phone> , and <address> provide clear descriptions for your information. Anyone else who looks at the file will be able to understand what information you are storing.

Because your phone book XML document is in a standard format, you can display the details on a web page. Web browsers contain an XML parser to process the XML content. You can also print out your contacts or even build a Flash movie to display and manage your contacts.

Your friends could agree on which tags to use and share their address books with each other. You can all save your contacts in the same place and use tags to determine who has contributed each entry. When you use a standardized structure for storage, the ways that you can work with the information are endless.

Foundation XML for Flash
Foundation XML for Flash
ISBN: 1590595432
EAN: 2147483647
Year: 2003
Pages: 93
Authors: Sas Jacobs

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net