we work round as follows:
         File inputFile = new File(xmlSource);
         if (inputFile.isFile() && inputFile.getParent() != null)
         {
            System.setProperty("user.dir", inputFile.getParent());
         }
         // parse input file

and restore user.dir after parse.
No good for URLs though, and only tested at all on windows.
It would be nice sometimes to have a PATH like property.


-----Original Message-----
From: Etienne Roy [mailto:[EMAIL PROTECTED]
Sent: 19 July 2001 15:26
To: [EMAIL PROTECTED]
Subject: Re: Schema not found


Armin,

Xerces look up the files relatively to the directory you're runnning your
prog in, and not the one your first schema is:

> > [Warning] :0:0: File "file:///home/dave/tmp/ML_primitive.xsd" not
found.

Your prog in running in home/dave/tmp/ where it's looking for ML_primitive,
that is not here but in xsd/.
If you change <include schemaLocation="ML_primitive.xsd"/> to <include
schemaLocation="xsd/ML_primitive.xsd"/> in ML.xsd, that works.
Same thing if you move both schemas in tmp/ and remove the relative path in
your instance.

> I have a schema which includes another schema. Xerces doesn't find the
> included schema, if the schema files and the xml file are in different
> directories. What can I do? I know I asked the same question a few days
ago,
> but there was no answer. I really need a solution to the problem.

Cheers

--
Etienne


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to