Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   XML (http://www.programmingforums.org/forum28.html)
-   -   modify xml doc using server-side language (http://www.programmingforums.org/showthread.php?t=7107)

glevine Nov 20th, 2005 4:00 PM

modify xml doc using server-side language
 
I am trying to determine if XML is something I can use in place of a mysql database for a small project. It seems very promising for my purposes, but I can't seem to find one piece of information that is necessary for this to work. Is it possible to use a server-side language, like php, to modify the XML document that resides on the server so that users can make changes to the data stored in the file? I'd be surprised if this isn't possible, but I haven't found anything which gives me an answer to this question. Hopefully someone here can help me out. Thanks.

Dameon Nov 20th, 2005 5:04 PM

XML parsing in most server-side languages can be a tad cumbersome/slow. An alternative is to use the traditional PHP + Database option but output XML instead of HTML. That can be used by client applications as well as webbrowsers. Tack on an XSL stylesheet link to the top and it renders like a regular web page.

Example:
http://newsrss.bbc.co.uk/rss/newsonl...nology/rss.xml

glevine Nov 20th, 2005 6:44 PM

I like that idea. Thanks for the suggestion. I will try that. But just out of curiosity, is XML document manipulation, on a file on a server, possible with server-side code? It seems to me that if you can build an xml document then you should be able to modify one.

Lich Nov 20th, 2005 11:20 PM

Quote:

Originally Posted by glevine
I like that idea. Thanks for the suggestion. I will try that. But just out of curiosity, is XML document manipulation, on a file on a server, possible with server-side code? It seems to me that if you can build an xml document then you should be able to modify one.

XML is client side code, a file that's used to display data. You use something like PHP/ASP/PERL to generate it. That's how RSS works. PHP sucks the data out of a database and sticks it into XML, then other websites/applications come a long and play with the XML data.

I'd reccomend picking up XML in a nutshell, very very good book for this stuff.

Dameon Nov 20th, 2005 11:30 PM

XML has great application in a) data transmission and b) fairly constant storage.

RSS falls into A because it is used to transfer a set of info from another data source to any of a huge number of clients. Could be firefox, could be an aggregator.

GAIM (an instant messenger) stores its preferences in an XML file. This falls into B because the file is only accessed periodically to load it on startup and even less frequently to be rewritten when preferences change.

The issue with using XML as a database replacement is server-side overhead and a lot of file locking. Databases are optimized for concurrent access and storage. Each has its use.

Lich Nov 21st, 2005 8:28 AM

Quote:

Originally Posted by Dameon
GAIM (an instant messenger) stores its preferences in an XML file. This falls into B because the file is only accessed periodically to load it on startup and even less frequently to be rewritten when preferences change.

Trillian does the same thing. We're going to see XML a lot more than we already do, it's going to be literally everywhere in the next 2 years.

DaWei Nov 21st, 2005 8:49 AM

Quote:

XML is client side code, a file that's used to display data.
Please elaborate.

Lich Nov 21st, 2005 8:53 AM

Quote:

Originally Posted by DaWei
Please elaborate.

I guess hold data would be more appropriate. It's code, non executing, that just has data in it, to be used by something else.

DaWei Nov 21st, 2005 9:30 AM

Quote:

Originally Posted by w3.org
Extensible Markup Language (XML) is a simple, very flexible text format derived from SGML (ISO 8879). Originally designed to meet the challenges of large-scale electronic publishing, XML is also playing an increasingly important role in the exchange of a wide variety of data on the Web and elsewhere.

Simple to look at, anyway. Parsing is a nice exercise. :)


All times are GMT -5. The time now is 9:30 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC