You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Robert McCarthy <rm...@vasocor.com> on 2002/05/23 21:53:50 UTC

FW: Xerces-C 1.6.0 Does Not Validate Date Value

Here is the pertinent information:

xerces-c++ version 1.6.0, built from xerces-c-src1.6.0 using CBuilder5
operating system: Windows 2000 Professional, version 5.00.2195, Service Pack
2
compiler: default CBuilder5 C++ compiler
xml file: see attached file named PatientInfo.xml
schema file: see attached file named PatientInfo.xsd
source code file: see attached PatientInfoXml.cpp and PatientInfoXML.hpp

How it works: I call PatientInfoXml::createDomFromXml() with the following 2
parameters:
pXmlFileUrl: file://localhost/C:\\ProgramLibs\\Wrox\\PatientInfo.xml
useSchemaValidation: true

What happened: The <dateOfBirth> element is declared to be of type "date" in
the shema file.  I inserted <dateOfBirth>robert</dateOfBirth> into the xml
file.  Xerces should have thrown a validation error during the call to
parser->parse(pXmlFileUrl), but it did not.



 -----Original Message-----
From: 	Robert McCarthy [mailto:rmccarthy@vasocor.com]
Sent:	Thursday, May 23, 2002 3:37 PM
To:	'xerces-c-dev@xml.apache.org'
Subject:	Xerces-C Does Not Validate Date Value

Hi, I'm running Xerces-C 1.6.0 in a CBuilder5 environment.  I'm using the
DOMParser with schema validation enabled.  In my schema, I have the
following element:
	<xs:element name="dateOfBirth" type="xs:date"/>
In my XML file that I validate against this schema, I have the following
element:
	<dateOfBirth>robert</dateOfBirth>
Xerces does not report an error!

Does Xerces validate dates against schema definitions?

Thanks!

Robert