Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 20th, 2005, 4:00 PM   #1
glevine
Newbie
 
Join Date: Jun 2005
Posts: 22
Rep Power: 0 glevine is on a distinguished road
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.
glevine is offline   Reply With Quote
Old Nov 20th, 2005, 5:04 PM   #2
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 729
Rep Power: 4 Dameon is on a distinguished road
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
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote
Old Nov 20th, 2005, 6:44 PM   #3
glevine
Newbie
 
Join Date: Jun 2005
Posts: 22
Rep Power: 0 glevine is on a distinguished road
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.
glevine is offline   Reply With Quote
Old Nov 20th, 2005, 11:20 PM   #4
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
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.
__________________
--John Cruz
Web Developer
www.cruzweb.net
Lich is offline   Reply With Quote
Old Nov 20th, 2005, 11:30 PM   #5
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 729
Rep Power: 4 Dameon is on a distinguished road
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.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote
Old Nov 21st, 2005, 8:28 AM   #6
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
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.
__________________
--John Cruz
Web Developer
www.cruzweb.net
Lich is offline   Reply With Quote
Old Nov 21st, 2005, 8:49 AM   #7
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 9 DaWei is on a distinguished road
Quote:
XML is client side code, a file that's used to display data.
Please elaborate.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Nov 21st, 2005, 8:53 AM   #8
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
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.
__________________
--John Cruz
Web Developer
www.cruzweb.net
Lich is offline   Reply With Quote
Old Nov 21st, 2005, 9:30 AM   #9
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 9 DaWei is on a distinguished road
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:33 AM.

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