Re: [xml] XML Schema: Validating an instance document with multiple schemas



Hi,

I had a similar issue, and to overcome the limitation, I wrote a wrapper that modifies the "main" schema with new <xs:import schemaLocaltion=""/> tag for each secondary schema. Then you can validate in one pass.

Hope it helps.

Frank

Le 06/05/2011 05:24, Daniel Veillard a écrit :
On Thu, May 05, 2011 at 01:57:46PM -0400, Paul B. Cameron wrote:
[...]
The idea is that the app data model is extensible, and that the 'any' node
will contain data that will declare a new namespace and be validated by a
different schema. These schemas are not currently designed to use schema
include (xs:include).



The MSXML parser allows multiple schemas to be loaded into a collection,
which is then associated with the document that is to be validated. However,
it looks like the libxml2 schema API is designed to work with one
schema/context at a time. Am I correct?
   I think so, yes. On the other hand you can make multiple validation
pass, might be a bit harder when streaming but should be doable.

Daniel


--
Frank GROSS
Software Engineer - Web Services
Four J's Development Tools - http://www.4js.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]