List Info

Thread: Multiple schemata in memory




Multiple schemata in memory
user name
2006-06-22 13:35:32
Hi,

> -----Original Message-----
> From: xml-bouncesgnome.org [mailtoml-bo
uncesgnome.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
> as
> it does not know about B.xsd and C.xsd I got the error
code 1845:
> XML_SCHEMAV_CVC_ELT_1.

The error message would be even more interesting.

> How can I validate my document with these three files
in memory?
> 
> TIA and best regards
>   Andreas

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:
(from http://w
ww.w3.org/TR/xmlschema-1/#schema-loc)
"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
specification."

Regards,

Kasimier
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
Multiple schemata in memory
user name
2006-06-22 15:18:17
> > 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 
> > as it does not know about B.xsd and C.xsd I got
the error code 1845:
> > XML_SCHEMAV_CVC_ELT_1.
> 
> The error message would be even more interesting.

Sorry, my fault. I had the wrong schema file in the memory.
With the
correct file xmlSchemaParse returns NULL (I suppose it's
because it
cannot find the referenced (imported) schema file)...

[snip]
> Subsequent XML Schema documents are located using the 
> schemaLocation of an import/include in Libxml2. You
could 

I have to use the Pascal bindings and I am not sure if I can
realize
this. Maybe I can try to modify the
"schemasImports" pointer in the
xmlSchema struct?

Best regards
	Andreas
-- 
Andreas Tscharner                         
andreas.tscharnermetromec.ch
------------------------------------------------------------
------------
And the beast shall come forth surrounded by a roiling cloud
of
vengeance. The house of the unbelievers shall be razed and
they shall be
scorched to the earth. Their tags shall blink until the end
of days.
                                            -- The Book of
Mozilla 12:10

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )