You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by ta...@ca.ibm.com on 2000/03/27 18:28:39 UTC

Schema Validation with Xerces-J



First, I am a newbie at this, so please bear with me.

I am trying to use the the schema validation feature in Xerces-J and I am
running
into a ConnectException: Connection timed out.  Any help is greatly
appreciated.


I have the following code... (for simplicity I will take out all the
try/catch blocks)

     DOMParser parser = new DOMParser();
     parser.setFeature("http://xml.org/sax/features/validation", true);
     parser.setErrorHandler(errorHandler);
     InputSource input = new InputSource(new FileInputStream(args[0]));
     parser.parse(input);


the following schema doc...

<schema xmlns="http://www.w3.org/1999/XMLSchema">
     <ElementType name="doc" base="string"/>
</schema>

and the following xml doc...

     <?xml version="1.0"?>
     <doc xmlns="foo.xsd">Hello</doc>




Cheers,

Tammam



Re: Schema Validation with Xerces-J

Posted by Michael Hucka <mh...@bbb.caltech.edu>.
>>>>> On 27 Mar 2000, talhamwy@ca.ibm.com wrote:

  talhamwy> I am trying to use the the schema validation feature in Xerces-J
  talhamwy> and I am running into a ConnectException: Connection timed out.

Are you behind a network firewall, by any chance?  If so, this is probably
the source of your problem.  Xerces is trying to resolve the references in
the schema, and fails to make the network connection.  

I had the same problem when I first tried to use validation.  We're behind a
firewall that requires SOCKS to get through.  I ended up copying the schema
definition files and munging them to make all references go to the local
copies of the schemas.

-- 
Mike Hucka, Ph.D.   --    mhucka@caltech.edu    --    ph: 626.395.6818
  Postdoctoral researcher, software developer, systems administrator
    GENESIS Development Group, Division of Biology 216-76, Caltech