Re: [xml] Multiple schemata in memory


-----Original Message-----
From: xml-bounces gnome org [mailto:xml-bounces gnome org] On 
Behalf Of Andreas Tscharner

Hello World,

I have three schemata: A.xsd, B.xsd and C.xsd. A.xsd is the "master"
schema: it imports B.xsd; B.xsd on the other hand imports C.xsd.
If I load A.xsd from the filesystem with xmlSchemaNewParserCtxt, the
validation against my test file works and is successful.

Now my problem: A.xsd, B.xsd and C.xsd are all in memory in different
places. I am able to "load" A.xsd using xmlSchemaNewMemParserCtxt, but
it does not know about B.xsd and C.xsd I got the error code 1845:

The error message would be even more interesting.

How can I validate my document with these three files in memory?

TIA and best regards

Subsequent XML Schema documents are located using the @schemaLocation
of an import/include in Libxml2. You could modify Libxml2's IO layer
and use a propriatery URI scheme to redirect the acquisition of the
schema document to your in-memory string. So similar to the 
xml-catalog mechanism. I currently think that we don't need an extra
input mechanism for the XML Schema module.

The spec does not mention a specific mechanism for this scenario:
"Note: As discussed above in Layer 2: Schema Documents, Namespaces
and Composition (§4.2), other non-Web mechanisms for delivering
schemas for ·assessment· may exist, but are outside the scope of this



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