Dianne Richards <dianne...@gmail.com> wrote on 07/18/2011 12:21:58 PM:

> Hi - I'm trying to access a local schema file using the property
> http://apache.org/xml/properties/schema/external-schemaLocation. It
> doesn't seem to work. Currently I'm using the property http://
> java.sun.com/xml/jaxp/properties/schemaSource with the following code:
>
> FileInputStream schema =
>                 new FileInputStream(new File("G:/workspace_2.1.x/
> test/src/test/xml/any/bse/base.xsd"));
> parser.setProperty
>             ("http://java.sun.com/xml/jaxp/properties/schemaSource";,
>                 schema);
>
> This works. But, I want to be able to specify 2 schemas ...

There's no reason why you can't do that with the "schemaSource" property.
Just pass in an array of InputStream if you want to specify multiple schema
documents.

Better yet use String[] so that the schema loader will be able to resolve
any relative URIs that might appear in your schema in
includes/imports/redefines.

> ... which is valid for the schemaLocation and the documentation for
http://
> apache.org/xml/properties/schema/external-schemaLocation says is
> possible. But, I can't even get 1 to work. I've tried the following
> different combinations for the property value:
>
> file:///G:/workspace_2.1.x/test/src/test/xml/any/bse base.xsd
> file:///G:/workspace_2.1.x/test/src/test/xml/any/bse/base.xsd
> file:/G:/workspace_2.1.x/test/src/test/xml/any/bse base.xsd
> file:/G:/workspace_2.1.x/test/src/test/xml/any/bse/base.xsd
>
> Is this supposed to work - specifying a local file url? If so, am I
> doing something wrong?
>
> Thanks for your help - Dianne

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrgla...@ca.ibm.com
E-mail: mrgla...@apache.org

Reply via email to