You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Shah Asrani <sh...@gmail.com> on 2009/02/25 15:58:37 UTC

XML Schema parsing

Hi
I have used XML Schema API with xerces to parse a xsd file.  I have
two xsd files.
schemaA.xsd
schemaB.xsd.

schemaA.xsd imports schemaB.xsd.  When files are on filesystem and I
use api to parse schemaA.xsd, it works fine as it can find schemaB.xsd
on filesystem.

However, in the logic I am working with, schemaA.xsd and schemaB.xsd
are stored as Strings in Database and at runtime, the string values of
schemas are retrieved.  I use API to parse the string repesentation of
schemaA.xsd and I get a warning that library failed to load
schemaB.xsd.  I understand that library fails to find schemaB.xsd.

How to inform library that schemaB.xsd should be loaded from a String
in memory rather than from filesystem.?

Best Regards,

Shah Asrani

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: XML Schema parsing

Posted by Shah Asrani <sh...@gmail.com>.
Hi Michael,
Thanks for quick response.

On Wed, Feb 25, 2009 at 11:17 PM, Michael Glavassevich
<mr...@ca.ibm.com> wrote:
> Hi Shah,
>
> You should write a resource resolver [1] and register it with the XSLoader
> [2]. Your code would resolve the schema to the representation you already
> have in memory.
>
> Thanks.
>
> [1]
> http://xerces.apache.org/xerces2-j/javadocs/api/org/w3c/dom/ls/LSResourceResolver.html
> [2]
> http://xerces.apache.org/xerces2-j/javadocs/xs/org/apache/xerces/xs/XSLoader.html
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
>
> Shah Asrani <sh...@gmail.com> wrote on 02/25/2009 09:58:37 AM:
>
>
>> Hi
>> I have used XML Schema API with xerces to parse a xsd file.  I have
>> two xsd files.
>> schemaA.xsd
>> schemaB.xsd.
>>
>> schemaA.xsd imports schemaB.xsd.  When files are on filesystem and I
>> use api to parse schemaA.xsd, it works fine as it can find schemaB.xsd
>> on filesystem.
>>
>> However, in the logic I am working with, schemaA.xsd and schemaB.xsd
>> are stored as Strings in Database and at runtime, the string values of
>> schemas are retrieved.  I use API to parse the string repesentation of
>> schemaA.xsd and I get a warning that library failed to load
>> schemaB.xsd.  I understand that library fails to find schemaB.xsd.
>>
>> How to inform library that schemaB.xsd should be loaded from a String
>> in memory rather than from filesystem.?
>>
>> Best Regards,
>>
>> Shah Asrani
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
>> For additional commands, e-mail: j-users-help@xerces.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: XML Schema parsing

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Shah,

You should write a resource resolver [1] and register it with the XSLoader
[2]. Your code would resolve the schema to the representation you already
have in memory.

Thanks.

[1]
http://xerces.apache.org/xerces2-j/javadocs/api/org/w3c/dom/ls/LSResourceResolver.html
[2]
http://xerces.apache.org/xerces2-j/javadocs/xs/org/apache/xerces/xs/XSLoader.html

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Shah Asrani <sh...@gmail.com> wrote on 02/25/2009 09:58:37 AM:

> Hi
> I have used XML Schema API with xerces to parse a xsd file.  I have
> two xsd files.
> schemaA.xsd
> schemaB.xsd.
>
> schemaA.xsd imports schemaB.xsd.  When files are on filesystem and I
> use api to parse schemaA.xsd, it works fine as it can find schemaB.xsd
> on filesystem.
>
> However, in the logic I am working with, schemaA.xsd and schemaB.xsd
> are stored as Strings in Database and at runtime, the string values of
> schemas are retrieved.  I use API to parse the string repesentation of
> schemaA.xsd and I get a warning that library failed to load
> schemaB.xsd.  I understand that library fails to find schemaB.xsd.
>
> How to inform library that schemaB.xsd should be loaded from a String
> in memory rather than from filesystem.?
>
> Best Regards,
>
> Shah Asrani
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org