> 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 - [EMAIL PROTECTED]
------
"The internet is full, beat it"
    - Me.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to