Validating XML structure with PHP
| From: | Eli | Date: | Tue, 29 Mar 2005 03:26:24 +0000 |
| Subject: | Validating XML structure with PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-211751@lists.php.net to get a copy of this message | ||
Hi,
I want to validate an XML structure using PHP.
I thought of using PHP's DOM and XSD or DTD for validation. This does the job ok, except on invalid XML structure I get the same error code. What I want is to point exactly why the XML structure is invalid. I know there's also an error message that gives a bit more precision on the cause, but it's not something I can show the user.
Is there another way to validate XML structure (that can give a precise error cause, like missing element, invalid element value, etc)?
-thanks, Eli