Re: [xml] XML validation

Yan Seiner wrote:
Daniel Veillard wrote:
Hum, PHP uses libxml2 at least starting from 5.0. You should be able to capture the parsing error messages, check the docs, I would
be really surprized if it wasn't there.


Well, I found this:


which can be adapted easily enough. The key is the passthru function which I didn't even know existed....
for early versions of PHP 5 errors from libxml2 are emitted as PHP Warnings/Notices so you need to implement an error handler if you want to capture and handle them. As of 5.1.0+, trappable structured errors were implemented. See: This type of error handling can be used with any of the XML based extensions, not just DOM.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]