Re: [PHP-XML-DEV] Validating XML
[email protected] (Adam Maccabee Trachtenberg) Wed, 16 Jun 2004 01:25:00 -0400 (EDT)
| Newsgroups | php.xml.dev |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 16 Jun 2004, %u wrote: > Warning: Element comment: failed to validate basic type date in > c:\program files\apache > group\Apache\htdocs\xmlimporter\importerfactory.php on line 21 > > This is causing me some distress as it is a completely unexpected > warning that kicks out of my function with no return value. This is a libxml2 schema validation error that the PHP DOM extension is just passing along. When such an error occurs, the schemaValidate() method should return false. > //original working code from xsd > <xsd:element name="comment" type="xsd:string"/> > > //code which makes xml invalid > <xsd:element name="comment" type="xsd:date"/> What I believe the error is trying to express is that your XML Schema has declared the comment element to be of the basic (as compared to complex) type "date," but your document contains a different type of element. Hence it "failed to validate basic type date." I agree that this isn't the most informative of error messages, but as I said, this is what libxml2 generates. If we want to fix it, we need to fix the libxml2 sources, which is actually easier done than I'm making it out do be, but is harder than just making a change to the PHP DOM extension. Make sense? -adam -- [email protected] author of o'reilly's php cookbook avoid the holiday rush, buy your copy today!