Forum Moderators: open
So, why should I use XML? What adv does it give me, and where will I use it? A lot of people have told me to use it with security applications (expecially when tied in with PHP, because of a few security flaws), but how?
At the moment, I haven't found a convincing enough opinion to change to XML! So i get to use my own tags, Ive spent time mastering XHTML, SQL and other languages, and now I have to make one up myself? Why?
If the application I make works, why do I need XML?
Please help! :D
You asked why the world has become obsessed with it, because it is easy for data exchange. That's my view.
I know this may sounds ridiculous to some people, but I am finding out that a flat file format coupled with SQL and ASP (or PHP and MySQL) is actually better than ASP/SQL alone. This approach actually dictates that XML can be dynamic, like MrMister said can happen with HTML.
I am not saying to replace ASP/SQL with XML, but use XML as a compliment.
One application is to use your ASP or PHP and ceate dynamic XML with it and then hand the format over to a web site that you want to exchange the data with.
If you don't have that requirement, then you may have no need for XML.
One application is to use your ASP or PHP and ceate dynamic XML with it and then hand the format over to a web site that you want to exchange the data with.
Yes, I do a similar thing, although I cache the output on disk (as .xml files) for any data that doesn't change on every access.
The advantage I see is that you're seperating your code in to layers
SQL DB -> ASP -> XML -> XSLT -> HTML,WML or XHTML -> CSS
This way, a designer doesn't have to worry about ASP (or more specifically, I don't have to worry about the designer breaking my ASP) when they're working on the page design.
I have been working this way for years, just using a proprietary format rather than XML. The benefit of XML is that it's a standard format so any designer can work with it without me having to explain how my proprietry templating system works.
I understand that its a good transporter of data, hence why we have RSS/Atom/RDF and so on and I have created a 'dynamic' RSS feed (well not really dynamic, I use PHP to update the XML file once new news is added!
But do you think that XML will ever become fully dynamic?
Oh hang on, I think Ive figured it out...
Create a script that writes an XML file of your database and on the other side, use a parser that picks up info from each specific conditional item...
But what about security eh?
Now see why didn't someone tell me that in the first place?
Because there's a million different ways of using it. That was just one of them.
But do you think that XML will ever become fully dynamic like PHP/ASP and other SSI techs can be?
It's not an SSI technology.
You're not understanding what XML is. It's a format for marking up data, like HTML or CSV to some extent.
ASP is a development platform. When you use ASP, I expect you use it to generate HTML. But HTML isn't dynamic.
You use ASP to generate HTML, well, you can also use it to generate XML. If you do that, then your XML is dynamic, just like your HTML is.
[edited by: mrMister at 12:52 am (utc) on Mar. 31, 2005]
Create a script that writes an XML file of your database and on the other side, use a parser that picks up info from each specific conditional item...
Yes, that's one of about a zillion different uses you could have for XML.
It doesn't have to be a file. You generally don't write your HTML to file from your ASP code, and you don't have to write your XML data to a file either.
But what about security eh?
What about it?
If you're transferring data across the Internet and it's sensitive you can encrypt it...
If you were sending sensitive HTML documents over the Internet using HTTP, you'd probably use SSL.
In the same way, if you were sending sensitive XML documents over the Internet using HTTP, you'd probably use SSL.