I am using the xerces 2.5
java parser to do schema validation and have
run into a problem that I am not sure if it's with my schema or the
parser.
The problem is this:
I have a base schema (base.xsd) and I extend it with a (extension.xsd)
which defines a new complex type by extending one of the types defined
in the base.xsd. ( I use "<xs:import>" since the extension.xsd has a different target namespace)
An instance document using the base.xsd:
<base:RootMsg xmlns:base="http://www.foo.com/base"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.foo.com/base base.xsd"
language="en-us">
....
</base:RootMsg>
validates just fine.
But when I create an instance document using extension.xsd:
<base:RootMsg xmlns:base="http://www.foo.com/base"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.foo.com/userextension extension.xsd"
language="en-us" xmlns="http://www.foo.com/userextension">
....
</base:RootMsg>
I get an error right away complaining about "base:RoogMsg" not being
defined, when debuging this I see that the error occurs before the
parser tries to load the "extension.xsd" schema. the schema is loaded
just fine and it will validate against the type that is defined there
but it won't validate against anything in the base.xsd.
Is there something wrong with my instance document? or does this sound
like a parser problem?
thanks in advance for your help.
Eugene
[ March 24, 2004: Message edited by: Eugene Yusim ]