Re: XML

From: Date: Thu, 05 Apr 2001 06:17:52 +0000
Subject: Re: XML
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47181@lists.php.net to get a copy of this message
> If memory serves, I was told that "PHP at the present time can not validate > an XML document". It does everything else, but you will have to validate > everything on your own. > > In other words there is no current PHP function that can parse an .xml > document and judge if it is Well Formed or not. There is a whole discussion on whether a webserver should validate documents, or this be handled beforehand (with the nsgml parser f.ex). Some argue that validating XML documents each time before producing basically the same output is kind of ineffecient, others argue that they want to be sure that whenever an XML page is changed that it is right. In my oppinion the first is the best, as small errors in an XML page which occured when it quickly had to be hacked should not result in a showstopper on the live website. If somebody fubars the tags according to the DTD, then let them do that, at least the site is up to date, and not full of validating errors. This is the scheme I use on SunSITE.dk: 1. Write a DTD for your XML standard. 2. Create a PHP parser which translates the XML pages into HTML. 3. Edit the xml documents, and use 'nsgml' (or similar sgml parser) on them to ensure that they are right according to the DTD. (Validate outside the webserver, process inside) Regards, Soeren Staun-Pedersen - staun@netwarriors.org ------ "The internet is full, beat it" - Me.

« previous php.general (#47181) next »