Click to See Complete Forum and Search --> : How to parse XML
askohen
02-23-2005, 11:35 AM
Hi. I have been doing html for a number of years and have some very minor experience with javascript, XML, XSLT, and perl--though I am by no means a programmer. I want to make my pages more dynamic and powerful, mainly by incorperating database funtionality via html forms.
For example, I would like an html form to access a database
and display filtered results. I know I could do this with perl/cgi, but before I venture to really learn perl, I would like advice on what to use.
I would prefer to store my records in XML. But what would be the best method to use in order to use html forms to parse xml data? There is so much out there:
-cgi/perl, jsp, php, ColdFusion etc.
Going forward, if you had major time constraints, what would the best technology be to invest my time in learning well? Thanks so much, Aaron
There are probably a lot of perl modules (http://www.cpan.org/) that you could use to help you parse XML. My personal preference is PHP (although it may have limited functionality when compared to Perl), because it's very easy to use and the XML functions are at your fingertips immediately. If you have major time constraints, I doubt Perl would be the ideal language to learn. ColdFusion, an uncommon server-side language by Macromedia, is probably easiest to learn (though, from what I've read on it, it seems extremely limited). Coming in second, PHP is easier to learn than Perl or JSP. In fact, I would venture to say that Perl is the hardest language to learn out of the ones you mentioned. So if you're running really short on time, but you need/want to learn how to store information in a database, I'd say go with PHP. Of course, this is my biased opinion, so a second opinion might be good. In PHP, usually it's easiest to use a MySQL database to do your queries, rather than manually programming queries to seek out information from XML files; but that is entirely up to you - there are benefits/disadvantages on either side. Good luck! ;)
In fact, I just saw a thread comparing databases and XML (http://www.webdeveloper.com/forum/showthread.php?s=&threadid=55250) -- XML is for data storage, so if you're writing, for example, a CMS then you would be better off using a database. From what I've read in your original post, it might be a better idea for you to use a database in your case.
askohen
02-23-2005, 01:22 PM
Thanks! That was really helpful. Do you know of any PHP resources that you have found good for learning (books etc)...
Mainly the PHP forum here, PHP.net (http://www.php.net/), Zend PHP (http://www.zend.com/), and Google (http://www.google.com/) (to search for help with specific problems or something). At PHP.net there is a "getting started with PHP" tutorial and lots of other resources.