Hi Diamaju, thanks for responding. I'm not on a Windows server, but good to know, thanks for the tip.
Linux System
Apache Version 1.3.27
PHP Version 4.3.2
XML Support: active
XML Namespace Support: active
EXPAT Version 1.95.2
| SitePoint Sponsor |

Hi Diamaju, thanks for responding. I'm not on a Windows server, but good to know, thanks for the tip.
Linux System
Apache Version 1.3.27
PHP Version 4.3.2
XML Support: active
XML Namespace Support: active
EXPAT Version 1.95.2



then perhaps you have register_globals = off
in the article the author doesn't use $_GET and $_POST consequent, i got it working with a little rewriting, but stupidly deleted the files 2 or 3 days ago![]()

Yeah, globals are off. But I just found two articles that will help me get through life...
One tells me that EXPAT is a SAX parser, so I'll head in that direction instead of DOM for now. A second article author seems to be saying that SAX is the preferred method with PHP, which is my favorite scripting next to ActionScript.
DOM centric article
SAX (EXPAT) article
Thanks again.
I keep getting this error:
Fatal error: Call to a member function on a non-object in c:\appserv\www\xmltest\editarticle.php on line 33
As a CMS, this is bound to get sluggish.
But it would be interesting as a configuration system .
I am running this on Apache 1.3.29 with PHP 4.3.4 on windows. with DOM_XML enabled in php.ini. Not getting the results expecged in the article (xml files not showing up in listing, not able to edit or delete, getting blank pages)...is there a unix vs. windows issue with these files?
Very nice, and althought I won't be using it for a CMS, It still does teach you how to parse data from an XML document to your home page, whether the XML's source is internal or external.
I think the tutorial is good at showing how all the pieces join together. I think it is also good because you can implemnt the system on a web server without having to pay extra £££ for server extenstions. If I were to try and tweak this script for displaying news articles by date order though, I am not sure where I would start! Perhaps I will have a better look around the website.
A very nice start of a small CMS. But I see one implementation/security problem in this: When creating a new article, you just create a new file and write it. But for this to work you would need write permissions in the xml dir. Of course nobody wants that dir to be world-writable, so what is the best PHP solution to this?
i want to use this but makes a mistake its says Fatal error: Call to undefined function: domxml_open_file() why?
Nice tutorial Tom!
My only problem is the same as gabriel's: Although i'm using PHP 4.3.8, the function domxml_open_file() is not available on my system.. how do you turn this on??
and are you able to turn it on, if you are NOT the sysadmin of your server??
please give us a hint someone..
thank you!
you are getting the domxml errors because the copy of php that is installed on your server was not built with support for DOM, you will need to get it recomplied. You will need the current version of libxml2 and zlib. then compile with the --with-dom --with-zlib-src=[source path]
as the number of articles increase, its crazy to implement the searching mechanisms as described in this article.
A great article, certainly opened my mind on methods of content management. I was wondering if a more optimal result would come from sculpting this into a system that creates XML from db results ?
This was a great project to jump-start me on PHP and XML. I wrote a very simple little blog after experimenting with Tom's code.
Tom has more great stuff at MyerMan.com and TDDM.
i´ve installed PHP 4.3.11 with DOM-support on my apple OS X 10.3.8.
still, i get the following errors with index.php:
Warning: domxml_open_file(): Document is empty in /Users/patrick/Sites/xmltest/index.php on line 42
Warning: domxml_open_file(): Start tag expected, '<' not found in /Users/patrick/Sites/xmltest/index.php on line 42
Fatal error: Call to a member function on a non-object in /Users/patrick/Sites/xmltest/index.php on line 46
any help is appreciated.
patrickk.
problem solved: there was a .DS_Store-file in my /XML-folder
The best CMS article, I've ever seen. :)





And (in case you were unaware) OS X will create a new one every time you open that folder through finder.Originally Posted by patrickk
Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?
I get this error on the index page.. why?
Fatal error: Call to undefined function domxml_open_file() in /index.php on line 42
After experimenting with the article's code here, I took what I learned and started this project
After reading the replies in this thread I see that a db would be much more efficient - but it was a good exercise because I'm a PHP/XML newbie![]()
Cross-Browser.com, Home of the X Library
I don't know... for larger stuff a db is probably the way to go but for smaller content this might be just the ticket and combining with XSLT gives you all sorts of possibilities for syndication.Originally Posted by MikeFoster
I think too many people (myself included) get into a db only mindset when looking for data storage/retrieval solutions. I use XML in at least 50% of my web solutions but db's often win out in the data layer.
Come to think of it... I've been an XML newbie for too long.![]()
Andrew Wasson | www.lunadesign.org
Principal / Internet Development
Nice article except xml is absolutely nothing like html, apart from using < and > to define a tag. Good work, other than that.
very usefull...been thinking of how to webservices of .NET and my PHP site would ever work. I think the only way is through xml...correct me if i'm wrong.
after this i'll be surely starting this.
I'm not sure, but it seems like a lot more work is involved in creating and displaying xml based content rather than using a database. The benefits I do see however are the ease of syndication and data exchange via rss feeds, but you could always create xml/rss docs on the fly for download with php and a database call. It would be nice too to be able to migrate your whole website to a new server and easily just move the xml docs instead of the schema and data of a database, but how frequently does that happen.
One question I have - What are the speed differences for opening/closing a directory of xml files to search for specific data compared to searching a database?
Bookmarks