[xsd-users] XSD path location
Bradley Beddoes
beddoes at intient.com
Tue Feb 13 02:10:51 EST 2007
Hi,
I have CC this to the list for others.
Yes of course with a resolver you can do whatever you want.
When the resolver function is called it gives you the the schema
location amongst other details and you could in your code choose to
trust that location or go and load some other resource completely maybe
based on some lookup map you have created internally or any other way
you choose to implement it.
Of course this assumes your using Xerces directly to create DOMDocument
and then feeding that to XSD for unmarshalling but this is how I tend to
work anyway and our resource resolver works really well in the same type
of situation you have mentioned below.
regards,
Bradley
--
Bradley Beddoes
Lead Software Architect
http://intient.com
Intient - "Open Source, Open Standards"
Boer den, Johan J (NSC) wrote:
> Hi,
>
> Thanks for your reply. The problem is that there is already a xsd name
> present. We have to add in the xml message the absolute path before the
> xsd. Is it possible to do that.
>
> For example :
>
> Xsi:schemaLocation="http://schemaserver/schemas/1.0 ORDER.xsd"
>
> Should be changed to
>
> Xsi:schemaLocation="http://schemaserver/schemas/1.0
> /path/to/xsd/ORDER.xsd"
>
> regards
>
> Johan
>
> -----Oorspronkelijk bericht-----
> Van: Bradley Beddoes [mailto:beddoes at intient.com]
> Verzonden: dinsdag 13 februari 2007 7:48
> Aan: Boer den, Johan J (NSC)
> CC: xsd-users at codesynthesis.com
> Onderwerp: Re: [xsd-users] XSD path location
>
> Hi Johan,
> If I am understanding your requirements correctly have a look at
> creating your own implementation of DOMEntityResolver and assigning this
> to your parser, in that way you can write it to fetch resources from
> whatever location on your server you choose to.
>
> NB: This is for DOMBuilder there are similar resolvers you can implement
> for the other types of Xerces parser.
>
> regards,
> Bradley
> --
> Bradley Beddoes
> Lead Software Architect
>
> http://intient.com
> Intient - "Open Source, Open Standards"
>
> Boer den, Johan J (NSC) wrote:
>> Hi,
>>
>> We have this problem : In our xml message there is a xsd filename
>> specified. Our server who parse this xml message must have the xsd in
>> the same directory where the server is running, our xsd files are
>> locate in a different directory. The server core dumps because it
>> could not find these xsd files. We have tried to set the property
>> fgXercesSchemaExternalSchemaLocation with the path the xsd located on.
>> This thus not help. Our question : Is it possible to tell the parser
>> in with directory the xsd are located
>>
>> thanks
>>
>> Johan den Boer
>> Software developper Dutch railways
>>
>>
>> ----------------------------------------------------------------------
>> -------------------- Deze e-mail, inclusief eventuele bijlage(n), is
>> uitsluitend bestemd voor gebruik door de geadresseerde(n). Indien u
>> dit bericht abusievelijk heeft ontvangen, mag de informatie daarvan
>> niet worden gebruikt of openbaar gemaakt, noch aan derden worden
>> verstrekt. Wij verzoeken u om in dat geval direct contact op te nemen
>> met de afzender en de e-mail te vernietigen.
>>
>> This e-mail, including any appendix or appendices, is intended solely
>> for use by the addressee(s). If you have received this message in
>> error, the information it contains may not be used or disclosed, nor
>> may it be revealed to third parties. In that case, please contact the
> sender immediately and destroy the e-mail.
>
> ------------------------------------------------------------------------------------------
> Deze e-mail, inclusief eventuele bijlage(n), is uitsluitend bestemd voor gebruik door de
> geadresseerde(n). Indien u dit bericht abusievelijk heeft ontvangen, mag de informatie
> daarvan niet worden gebruikt of openbaar gemaakt, noch aan derden worden
> verstrekt. Wij verzoeken u om in dat geval direct contact op te nemen met de
> afzender en de e-mail te vernietigen.
>
> This e-mail, including any appendix or appendices, is intended solely for use by the
> addressee(s). If you have received this message in error, the information it contains
> may not be used or disclosed, nor may it be revealed to third parties. In that case,
> please contact the sender immediately and destroy the e-mail.
>
More information about the xsd-users
mailing list