|
|
Re: Controlling XML URI resolution [message #431875 is a reply to message #431830] |
Tue, 28 July 2009 15:22 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Note also that the URI converter of the resource set is consulted
InputStream inputStream = getURIConverter().createInputStream(uri,
options);
So with things like URI mappings or specialized URI handlers you might
be able to accomplish what you want...
Mario Winterer wrote:
> Hi Derek!
>
> Have a look at the two load/save options
> XMLResource.OPTION_RESOURCE_ENTITY_HANDLER and
> XMLResource.OPTION_URI_HANDLER.
> The values of these two options must be of type XMLResource.URIHandler
> and XMLResource.ResourceEntityHandler. They allow a finde grained
> control over uri resolution and entity handling. If you need both, you
> can implement both interfaces in one class and provider an instance
> via option OPTION_RESOURCE_ENTITY_HANDLER - XMLResource uses it as uri
> handler too.
>
> Mario
>
> "Derek Palma" <derek.palma@gmail.com> schrieb im Newsbeitrag
> news:h4l631$mpb$1@build.eclipse.org...
>> Hi,
>>
>> I am loading XML files with EMF and need to control the URI
>> resolution for the namespace URIs. Without EMF I am used to using an
>> EntityResolver for this by directly registering it with the Xml
>> parser API. I see that org.eclipse.emf.xmi.XMEDefaultHandler seems to
>> handle this and other related functions. However, it is not clear
>> what the right way to install my own EntityResolver is. I suspect
>> others have done this many times.
>>
>> What is the typical approach for installing an EntityResolve or just
>> hooking URI resolution with EMF?
>>
>> Thanks in advance,
>> Derek
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03780 seconds