When Xerces (using PSVI DOM) validates an element foo whose type is from schema A and that element has some content element bar (in A's target namespace) whose type is from schema B imported by schema A, everything works as expected: If bar's content conforms to its type, it will be reported valid, if not, validation will fail.
 
However, if I preparse schema A, access the schema grammar, convert to an XSModel, and get the XSElementDeclaration for bar, it will have a type of AnyType.  Apparently the import of B has not caused B to be parsed and its PSVI made accessible to the grammar for A.  If I also preparse schema B when I preparse A, the element declaration for bar has the correct type from schema B.
 
Is this behavior by design?  I would have thought that the import would lead to either immediate preparsing of the imported schema or deferred preparsing when some reference to B's namespace was made. 
 
My tests refer to Xerces 2.2.1 -- things could be different in later versions.
 
If this doesn't ring a bell with the developers, I can try to create a succinct test case.
 
Jeff
 
 
 

Reply via email to