Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why XML?

Status
Not open for further replies.

dowlat

Programmer
Aug 13, 2001
1
IR
Hi everybody:
I want to build dynamic site.I want to know why I should use XML.If there is any site can help me or any other reseans which you should tell me to lead me why I should use instead of ther thing ,please tell me
Thanks alot
 
well first of all what is "Ther Thing", yer being too vauge to give a good comparism, if we dont even know what we have to compare against.

Will tell you this much tho, XML with the XSL makes for a very easy data structure that is human readible, since its a markup language, meaning the tags and such, you invent them yourself within some proper structure guidelines. Right now I'm working on an XML data sheet with a coresponding XSL style sheet for one of my client , who does not have a database at all, I would much rather use MySQL database if I had a choice, but there is no database, and XML would be far more easier to just update then going thru the HTML and updating myself, and I use PHP so least I can transform the XML into HTML readible on the serverside, rather than the browser needing to support XML.

From the w3schools.com site :
Code:
What is XML?

    * XML stands for EXtensible Markup Language
    * XML is a markup language much like HTML
    * XML was designed to describe data
    * XML tags are not predefined. You must define your own tags
    * XML uses a Document Type Definition (DTD) or an XML Schema to describe the data
    * XML with a DTD or XML Schema is designed to be self-descriptive


XML does not DO anything

XML was not designed to DO anything.

Maybe it is a little hard to understand, but XML does not DO anything. XML was created to structure, store and to send information.

The following example is a note to Tove from Jani, stored as XML:

<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>

The note has a header and a message body. It also has sender and receiver information. But still, this XML document does not DO anything. It is just pure information wrapped in XML tags. Someone must write a piece of software to send, receive or display it.
XML is free and extensible

XML tags are not predefined. You must "invent" your own tags.

The tags used to mark up HTML documents and the structure of HTML documents are predefined. The author of HTML documents can only use tags that are defined in the HTML standard (like <p>, <h1>, etc.).

XML allows the author to define his own tags and his own document structure.

The tags in the example above (like <to> and <from>) are not defined in any XML standard. These tags are "invented" by the author of the XML document.

But again will be best to know what you are trying to compare aganist "XML vs ?????"

Karl Blessing
PHP/MySQL Developer
 
The nice thing is, is if you need a presentation method for your data, XML already compatible with XSL Style sheets, where as if I wrote all the data in MySQL i would have to design my own outputs around PHP. Where as with XML, I can Transform a XML data set, into the XSL style sheet, then spit it back out. And XSL is already a pretty powerful setup to displaying the data in XML rather than building your own template engine or parser.

Karl Blessing
PHP/MySQL Developer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top