Re: [xml] XML validation
- From: Rob Richards <rrichards ctindustries net>
- To: Yan Seiner <yan seiner com>
- Cc: xml gnome org
- Subject: Re: [xml] XML validation
- Date: Wed, 17 Jan 2007 12:19:16 -0500
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.
Daniel
Well, I found this:
<http://svncommunity.digium.com/view/asterisk-docs/scripts/xml-check.php?rev=1&view=markup>
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:
http://www.php.net/manual/en/function.libxml-use-internal-errors.php
This type of error handling can be used with any of the XML based
extensions, not just DOM.
Rob
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]