HTML & CSS
I am looking for this on the internet since the last six hours but of no use....
I want to know how XML is of any use.....
I know it helps to organize data/content. I know information stored with XML helps in showing the information in any format - on a web page, or in MS-word, or in a database, etc.
But such words/statements does not make things clears.......'for me'.........
I want to see an example.....Could anyone help??
Sitemaps for websites can be in XML format. I have a Google map which converts custom locations held in a database into flags on the map via XML.
They are more for making the data clear for machines to read, rather than 'for you', but humans should be able to understand the format too, so it can work for both. The data can be presented in a more human friendly way by software. For example KML files are XML, mapping programs like Google Earth read the data and display it in a way humans understand.
i'm pretty new to xml myself and from my very limited understanding the advantage with xml seems to be that it is a source of data that can be accessed by other people. Hopefully this is correct in my thinking...
If you have a mysql or MSsql database no-one outside of your website can access that database directly. So if you have a list of restaurants for example you can output that from your database on a php webpage but you can't easily share it like that. If you want someone else to be able to access that information to use on their website without having to copy and paste each time you could output your data to an xml page. They can then link to that xml page and interrogate the information and use what they need. If it changes on your site it automatically updates on their site.
I'm just learning this myself (i literally just posted a question about this today) and a good example of what xml can do is here http://findyourmp.parliament.uk/api which is the uk parliament api (example postcode to try if you aren't in the UK 'BS81ts'). By using a few variables i can return data from their xml page and use it on my site. If it changes on their site it will change on mine.
hope that helps
Thank you for that explanation, Noppy. I have avoided learning and using XML for years even though I've been told it's a very important skill to have, because I could never get my head around its purpose. You are the only person who has explained it so well that it actually makes a lot of sense.
glad it was useful. I've probably missed a few important details but this is my understanding so far.
this is a very good website http://www.tizag.com/xmlTutorial/ with useful easy to understand tutorials.
This topic is now closed. New replies are no longer allowed.