Reply
Old 08-23-2011, 10:50 PM   #1 (permalink)
 
Status: Senior Member
Posts: 329

Send a message via ICQ to FriendXavier


Default Why do I need XML. What is it's position in real life... the life of output

I have been asking this question from the first time I read about it in w3schools. I know what it is (or I only think so).
For example the making of my own tags... why do I need this? Can't the tag just be written in HTML?
Yea, maybe you will answer "Because XMLs priority is the carrying information and the information itself and HTML's job is to make the content sweet for the eye..."

But can't we carry information in databases (Or even .txt files!) or maybe XML carries info better (he he, and how?) and who needs to know something is (for example) a letter (by making for example a <letter> XML tag). Don't we actually need the output. I think that the output is the priority. Everything we make with scripts and codes is actually for the output...dynamic or static it's always the output. Why do we need a (for example) <letter> tag to be around some text for the text to be a letter. It can only change the text the same way the HTML can do...

I won't make more examples ( and maybe make you lough at me for my stupidity), but I will ask (as I am very confused about XML) that your answer contain for example a project that can be done with XML but can't be done another way so I can understand after all why does XML even exist.



(I have been searching A LOT about this but there are only articles about what is XML but not it's actual position in real life... the life of the output.)
FriendXavier is offline   Reply With Quote
Old 08-23-2011, 10:50 PM   #2 (permalink)
 
Status: Senior Member
Posts: 224



Default Why do I need XML. What is it's position in real life... the life of output

XML is advantageous because not only is it human readable but it's also machine readable. It has a specification that's agreed upon by many parties.That's where XML really shines. Since XML parsers are built into many programming languages, you can quickly retrieve and create information with XML.

A simple text (.txt) file would be less advantageous because depending on the way data is stored in the text file, it would require the programmer to create a custom parser function formatted to the specification of the text file format.

if I saved <foo> BAR </foo> as an XML, I can rest easy knowing that its structure allows it to be understood by many programming languages that can easily parse it with their built-in library.

The tree structure allows you to form relationships between different nodes:
<family>
<father>Bob</father>
<mother>Jane</mother>
<son>Billy</son>
</family>

In the above example, if I were to have hundreds of families in this XML, it would be easy to parse as I can loop through each family tree and group each child nodes (the family members) with their respective family.
Gypeplale is offline   Reply With Quote
more..

Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
C# real life best books ? Chozo Web Programming 0 11-14-2013 03:06 AM
Please help me - why, where , when, to learn real life c++? Hack Programming Languages 3 08-04-2013 03:05 PM
What is C# used for in real life? Arbaz PHP Code/ PHP Codes 6 02-16-2013 07:05 AM
I look better in Facebook than I do in real life? Unknown_User PHP Code/ PHP Codes 2 06-08-2012 02:06 PM
Galaxy Life Cheats HACK | Galaxy Life CHEATS | Galaxy Life CHEAT ENGINE Facebook download? Unknown_User Programming 0 02-09-2012 05:06 AM