XML 101

Written by Jeff Jones


Whether you're discussing e-commerce, knowledge management, orrepparttar Internet in general, you've likely seen or heard reference to eXtensible Markup Language (XML). XML is, without a doubt, one ofrepparttar 118062 most heralded technologies to come acrossrepparttar 118063 wire in recent years (pun intended). What is XML? Why is it creating such a deluge of interest? What should you know about XML, and perhaps more importantly, why should you even care about it? In this article, I will provide a high-level description of what XML is (and what it's not), discussrepparttar 118064 key components of an XML document, and provide a compelling argument for why it's well worth your while to learn more about XML.

To understand XML, it's helpful to compare and contrast it with another technology with which a great many of us are familiar - HyperText Markup Language (HTML).

If you've used or read about HTML, you know that it was created so that users could format and display information onrepparttar 118065 Web. HTML uses a fixed and finite set of tags, elements, and attributes that allow it to communicate to a user's browser how that browser should displayrepparttar 118066 document. We see HTML everywhere, and it has for some time served asrepparttar 118067 lingua franca for displaying information onrepparttar 118068 Web. It is a proven technology that well serves its purpose in most scenarios. What if, however,repparttar 118069 current version of HTML doesn't allow me to do something that I want to do? I have two choices: I can either write my own browser that understands my tags (bad idea) or I can put my project on hold for a year or so and hope thatrepparttar 118070 next version of HTML includesrepparttar 118071 functionality that I need (even worse idea). Try selling either of these options to your boss or client and see if you still have a job byrepparttar 118072 time you end your discussion. So concludes our one-paragraph, in-depth investigation of HTML.

Now, if I may lapse into my days of standardized test taking, HTML is to displaying information as XML is to defining information. They both are text-based, and they both consist of tags, elements, and attributes. Unlike HTML, however, XML allows users to structure and definerepparttar 118073 information in their documents. While technically it is a markup language (it allows you to use tags to "mark-up"repparttar 118074 contents of your document), it more appropriately is a meta-language. By meta-language, I mean that it allows users to create their own collection of tags, elements, and attributes as needed and in so doing to accurately describerepparttar 118075 physical contents of a document. Unlike HTML with its finite collection of tags, XML allows users to create their own to meet their own requirements (thusrepparttar 118076 eXtensibility).

I've made several references to tags, elements, and attributes. These arerepparttar 118077 core building blocks of an XML document. Considerrepparttar 118078 following HTML fragment. It should be painfully familiar to anyone who's ever looked at an HTML document and will prove useful in understanding XML syntax.

Here isrepparttar 118079 first group of text< d> Here isrepparttar 118080 second group of text< d> < r> < able>

This document contains a table element ("") with a table row element (""). The table row element, in turn contains two table cell elements ("
"). Each of these elements has both an opening tag ("") and a closing tag ("< able>"). While this is fairly straightforward, it also is somewhat inflexible. What if, for example, I need to create a document that describes my company's employee roster forrepparttar 118081 Annual InfoStrat softball tournament? With XML, it's as easy as replacingrepparttar 118082 element and attribute names fromrepparttar 118083 previous HTML document with my own custom tags that describe my company and its employees. Here is what such a document might look like:

Hank Aaron Babe Ruth

With this XML document, I have defined my company and two of its employees and have describedrepparttar 118084 relationship between company (parent) and employees (children). I have shown that my company has two employees, but I easily could add new employee elements to reflect new hires that we bring on to ensure that we don't lose this year's tournament:

Mickey Mantle Ty Cobb

After creating my XML document, I can display its contents in my format of choice. The same XML document could easily be displayed as HTML, a Microsoft Word document, an Adobe .pdf file, or even as text inrepparttar 118085 body of an e-mail message. As long asrepparttar 118086 XML document is well formed (meaning that it followsrepparttar 118087 appropriate XML format and syntax), you can choose your method of preference (or necessity) for displaying its content.

Let's dissectrepparttar 118088 pieces of my company roster XML document to see each piece's role and responsibility.

Header:

The header tellsrepparttar 118089 document's user that this is an XML document - using version 1.0 ofrepparttar 118090 XML specification in this case.

Hank Aaron Babe Ruth

XML Is About To Rock Your World

Written by Bill Daugherty


Envision a world in which you buy a new home appliance and it introduces itself to all of your other appliances and they figure out how to work together. Went you start your movie player it ordersrepparttar lights to dim,repparttar 118061 microwave to poprepparttar 118062 popcorn andrepparttar 118063 telephone to hold all your calls untilrepparttar 118064 movie is over.

This may sound like something out of a science fiction novel, but it is just aroundrepparttar 118065 corner thanks to an extensible markup language called XML. It sounds like your t-shirt size, but it is a powerful new addition torepparttar 118066 e- world and it is going to rock your world good.

A relative of HTML, XML promises to becomerepparttar 118067 common language for PCs, Macs and any other device that has a computer chip. The possibilities are endless.

This common language for all devices will make it possible to have networked cars and offices.

Automobiles that have allrepparttar 118068 components talking to one other and making adjustments based onrepparttar 118069 data received. Offices where allrepparttar 118070 machines, not just computer terminals, will be able to work together in a coordinated manner that will makerepparttar 118071 whole system many times more powerful and productive thatrepparttar 118072 individual machines working alone. XML andrepparttar 118073 Internet.

Cont'd on page 2 ==>
 
ImproveHomeLife.com © 2005
Terms of Use