Re: Please help

-----Original Message-----
From: zahra.valaie@firstunion.com <zahra.valaie@firstunion.com>
To: xmlschema-dev@w3.org <xmlschema-dev@w3.org>
Date: Wednesday, April 17, 2002 2:09 AM
Subject: Please help


>I am having problem parsing my xml against the schema, could you please
>help me??????????????
>
>The problem is that If I change the the data types in from int (specified
>in .xsd) to a string like (abc)in the .xml file,  I don't get an
>exception from the parser.
>
>here is my Java Code:
>
>try{

<snip/>
>          org.apache.xerces.parsers.DOMParser parser = new
org.apache.xerces.parsers.DOMParser();
>          parser.setFeature ("http://xml.org/sax/features/validation",
true);
>          parser.setFeature
("http://apache.org/xml/features/validation/schema", true);
>          //parser.setProperty(
>          //   "file:///C:\\FirsTeam\\Internet\\xml",
>          //   new org.xml.sax.InputSource("payroll.xsd"));
>          ErrorChecker errors = new ErrorChecker();
>          parser.setErrorHandler(errors);

Are you sure, that your ErrorChecker can thow any exception? May be it
handle them by itself?

BTW, take a look on Creative Science Systems's Schema2JavaCompiler - it
generates good Java classes with embedded validators from xsd definitions.
And it's very usefull for me.
See the http://www.creativescience.com/nz.ste.s2j.main.html for details.

WBR, Dennis Melentyev

Received on Tuesday, 23 April 2002 16:31:17 UTC