How to ignore certain features in a resource. [message #408743] |
Mon, 23 April 2007 11:32  |
Eclipse User |
|
|
|
Originally posted by: VMarathe.ifmc.sdps.org
Hi,
I am wondering if I would be able to ignore a set of certain features
while loading an EMF resource.
Basically, I have two products.
1. Product B --> contains Product A. (These are actually eclipse
features but I want to avoid confusion with emf features.)
2. Product B has b.xsd and Product A has A.xsd such that B.xsd imports
A.xsd.
3. Product A has A model, Product B has B model.
If I create an EMF XML resource with elements from B as well as A, and
send it to A model, I would like to process only A specific EMF features
while ignoring B specific EMF features. With current settings, it's
going to fail since A product ALONE does not contain B model.
XML will look like following:
<B:x>
<B:y/>
</B:x>
<A:m>
<A:n/>
</A:m>
How do I accomplish this?
Thanks,
Vasant.
|
|
|
Re: How to ignore certain features in a resource. [message #408745 is a reply to message #408743] |
Mon, 23 April 2007 11:41   |
Eclipse User |
|
|
|
Vasant,
Probably XMLResource.OPTION_RECORD_UNKNOWN_FEATURE will help. With this
approach, its possible to write back out the original unrecognized data,
or to clear the getEObjectToExtensionMap to discard it.
Vasant Marathe wrote:
> Hi,
>
> I am wondering if I would be able to ignore a set of certain features
> while loading an EMF resource.
>
> Basically, I have two products.
> 1. Product B --> contains Product A. (These are actually eclipse
> features but I want to avoid confusion with emf features.)
> 2. Product B has b.xsd and Product A has A.xsd such that B.xsd imports
> A.xsd.
> 3. Product A has A model, Product B has B model.
>
> If I create an EMF XML resource with elements from B as well as A, and
> send it to A model, I would like to process only A specific EMF
> features while ignoring B specific EMF features. With current
> settings, it's going to fail since A product ALONE does not contain B
> model.
>
> XML will look like following:
>
> <B:x>
> <B:y/>
> </B:x>
>
> <A:m>
> <A:n/>
> </A:m>
>
> How do I accomplish this?
>
> Thanks,
> Vasant.
|
|
|
Re: How to ignore certain features in a resource. [message #408747 is a reply to message #408745] |
Mon, 23 April 2007 12:12   |
Eclipse User |
|
|
|
Originally posted by: VMarathe.ifmc.sdps.org
Hi Ed,
Thanks, for the quick reply. That solves most of my problem.
One follow up question:
As I was writing the earlier post, I realized if it could also be
possible to distinguish between the intended set of features to ignore
and true errors like <A:m11> instead of <A:m> or misspelled attributes
of such elements.
Thanks,
Vasant.
Ed Merks wrote:
> Vasant,
>
> Probably XMLResource.OPTION_RECORD_UNKNOWN_FEATURE will help. With this
> approach, its possible to write back out the original unrecognized data,
> or to clear the getEObjectToExtensionMap to discard it.
>
>
> Vasant Marathe wrote:
>> Hi,
>>
>> I am wondering if I would be able to ignore a set of certain features
>> while loading an EMF resource.
>>
>> Basically, I have two products.
>> 1. Product B --> contains Product A. (These are actually eclipse
>> features but I want to avoid confusion with emf features.)
>> 2. Product B has b.xsd and Product A has A.xsd such that B.xsd imports
>> A.xsd.
>> 3. Product A has A model, Product B has B model.
>>
>> If I create an EMF XML resource with elements from B as well as A, and
>> send it to A model, I would like to process only A specific EMF
>> features while ignoring B specific EMF features. With current
>> settings, it's going to fail since A product ALONE does not contain B
>> model.
>>
>> XML will look like following:
>>
>> <B:x>
>> <B:y/>
>> </B:x>
>>
>> <A:m>
>> <A:n/>
>> </A:m>
>>
>> How do I accomplish this?
>>
>> Thanks,
>> Vasant.
|
|
|
Re: How to ignore certain features in a resource. [message #408750 is a reply to message #408747] |
Mon, 23 April 2007 12:46  |
Eclipse User |
|
|
|
Vasant,
It's possible to post process the information in the
getEObjectToExtensionMap() to see what attributes and elements were
present and then to decide which ones represent errors as opposed to
expected problems.
Vasant Marathe wrote:
> Hi Ed,
>
> Thanks, for the quick reply. That solves most of my problem.
>
> One follow up question:
> As I was writing the earlier post, I realized if it could also be
> possible to distinguish between the intended set of features to ignore
> and true errors like <A:m11> instead of <A:m> or misspelled attributes
> of such elements.
>
> Thanks,
> Vasant.
>
>
> Ed Merks wrote:
>> Vasant,
>>
>> Probably XMLResource.OPTION_RECORD_UNKNOWN_FEATURE will help. With
>> this approach, its possible to write back out the original
>> unrecognized data, or to clear the getEObjectToExtensionMap to
>> discard it.
>>
>>
>> Vasant Marathe wrote:
>>> Hi,
>>>
>>> I am wondering if I would be able to ignore a set of certain
>>> features while loading an EMF resource.
>>>
>>> Basically, I have two products.
>>> 1. Product B --> contains Product A. (These are actually eclipse
>>> features but I want to avoid confusion with emf features.)
>>> 2. Product B has b.xsd and Product A has A.xsd such that B.xsd
>>> imports A.xsd.
>>> 3. Product A has A model, Product B has B model.
>>>
>>> If I create an EMF XML resource with elements from B as well as A,
>>> and send it to A model, I would like to process only A specific EMF
>>> features while ignoring B specific EMF features. With current
>>> settings, it's going to fail since A product ALONE does not contain
>>> B model.
>>>
>>> XML will look like following:
>>>
>>> <B:x>
>>> <B:y/>
>>> </B:x>
>>>
>>> <A:m>
>>> <A:n/>
>>> </A:m>
>>>
>>> How do I accomplish this?
>>>
>>> Thanks,
>>> Vasant.
|
|
|
Powered by
FUDForum. Page generated in 0.07386 seconds