
|
View Full Version : What is XMLfor?
JustinSmall 09-29-2008, 09:20 PM What is XML for, and what are the benefits to it?
I've heard a lot of hype about it, but never really checked it out… finally got interested in finding out what it's about!
Jatinder 09-30-2008, 12:29 AM We use XML to transfer data from PHP to Flash applications. Whenever Flash needs to pull data from a database, it connects to a PHP script. The PHP script in turn fetches the data from the database, formats it into XML and outputs the file. Flash application then parses this XML data.
I think what I described above is the most common usage for XML. That is, to share data between two separate systems.
Augury 09-30-2008, 02:33 AM XML is just an "Extensible Markup Language". Basically, it allows the creator to use their own markup tags. It is primarily used for exchanging data. For instance, if you had a client and a slave the slave may request a piece of data... say fetchusers. The server could respond in XML
<users><user><name>User1</name><e-mail>Email1</email></user></users>
Your slave then processes/consumes your xml document and has the data requested.
Just one example.
priyakochin 09-30-2008, 02:54 AM XML mean Extensible Markup Language, it allows one different programming languages to communicate.
JustinSmall 09-30-2008, 08:11 AM Well that's kind of neat…
I don't really use Flash, or try to communicate any separate languages as a matter of fact, but it's still pretty neat!
Thanks for the valid info WHT :)!!!
etogre 09-30-2008, 12:21 PM Another common use for XML is making RSS feeds. If you have a "news & updates" section of the site for instance, it's nice to add a feed link. RSS is very simple to create, it follows a very basic format.
http://www.devshed.com/c/a/PHP/Rockin-RSS-with-PHP-on-your-HTML/
jt2377 10-01-2008, 01:17 AM XML is meta data basically it mean it describe what data is for example:
<book>
<title>C# for dummies</title>
</book>
it's great if you going to send out data to the other end. you can use DTD for validation before sending it out. It can be use for many thing. I have seem it where you can use it like a light weight database, configuration file, webservice...etc.
plumsauce 10-01-2008, 03:39 AM XML, solution looking for a problem.
There is actually a new generation banking software "consultant" walking around town who really believes that it is faster to process large volume data interchange with XML than with say, a flat file. He *really* believes it. Mind you, he's never done something so menial as to actually write code.
There's one born every minute, and the birth rate is accelerating.
Jatinder 10-01-2008, 06:48 AM XML, solution looking for a problem.
Not exactly, XML does have practical uses. One of them being what I described in my previous post.
There is actually a new generation banking software "consultant" walking around town who really believes that it is faster to process large volume data interchange with XML than with say, a flat file.
XML does offer more flexibility than flat file. But I haven't used XML for large volume data so can't comment on that.
mod_webhosting 10-01-2008, 07:05 AM Two advantages of XML over plain file that come to my mind file are extensibility and data hierarchy. Look at this example:
<users>
<user>
<name>
<first>John</first>
<last>Doe</last>
</name>
<email>john@example.com</email>
</user>
<user>
<name>
<first>Jane</first>
</name>
<email>jane@example.com</email>
</user>
</users>
In the previous example it is easy to spot who owns the jane@example.com address because the data is hierarchly organized.
As for the extensibility, you can use the previous response from my server and if next month I add a new tag <web> to my response, your code will not break.
Although you can use XML for data storage, it is not made for that. It is made for data exchange, like a common language that two particular system both understand. Handling a large amount of data with XML is, generally speaking, not wise.
sasha 10-01-2008, 07:12 AM Personally, for web based applications I choose JSON over XML. I do not see why bother with XML at all.
etogre 10-01-2008, 09:43 AM I had to use XML on a project for a gaming site once. The WoW armory (http://www.wowarmory.com/character-sheet.xml?r=Firetree&n=Shampoop) and EvE API (http://myeve.eve-online.com/api/doc/) both use XML for video game character data that I had to parse and populate a database with. Show me a flat file that comprehensive.
JustinSmall 10-01-2008, 03:30 PM Yay! I started a little hit and didn't even mean to, kudos to you guys!
|