You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Jason E. Stewart" <ja...@openinformatics.com> on 2001/10/02 01:03:15 UTC

Re: schema is in string, not in file

"Vladimir Sinichkin" <si...@barak-online.net> writes:

> Thanx a lot for your recommendations :-) You helped me very much!

Great, glad to hear it. I've learned a bit myself ;-)

> But I still have 2 more small questions:
> 
> 1. Do I have to keep xsi:noNamespaceSchemaLocation='' attribute in my xml
> string?
>     Is there any other way to tell to the parser to use a schema, which I
> provide by EntityResolver?

Apparently not. You just need to supply enough information about the
name of the schema (which gets passed as the systemId argument to
resolveEntity()) so that you get get what you need from your DB.

> 2. As you told me I wrote  subclass from EntityResolver. This class has a
> method
>     resolveEntity that gets 2 arguments:
>     InputSource*  SchemaResolver::resolveEntity(const XMLCh* const publicId,
>                                            const XMLCh* const systemId) ;
>     I need to use those arguments to bring right schema for different
> versions of XMLs.
>     But the bpoblem is that this method is called by the parser (not by ne
> script).
>     So, the question is how can I know what the parser passes in those 2
> arguments?
>     Is there any way to control it?

Right. The parser will invoke resolveEntity() and it will pass the
value of the *SchemaLocation attribute as the systemId argument. So
your entity resolver needs to be able to take the system ID with that
information create the appropriate schema from your DB, and return a
MemBufInputSource to the parser.

HTH,
jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org