|
|
Re: EMF Compare - Comparing XSD (XML schema) [message #124762 is a reply to message #123297] |
Mon, 02 June 2008 07:34 |
Muhamad Nazir Messages: 24 Registered: July 2009 |
Junior Member |
|
|
Thanks laurent for the answers. I already downloaded this sample:
"org.eclipse.emf.compare.examples.standalone". As I mentioned before, I'll
be using EMF Compare programmatically, I hope you can give me tips on
comparing XMLschema. I already put the same codes as:
<excerpt>
// Loading models
EObject model1 = ModelUtils.load(model1, resourceSet);
EObject model2 = ModelUtils.load(model2, resourceSet);
// Matching model elements
MatchModel match = MatchService.doMatch(model1, model2,
Collections.<String, Object> emptyMap());
// Computing differences
DiffModel diff = DiffService.doDiff(match, false);
// Merges all differences from model1 to model2
List<DiffElement> differences = new
ArrayList<DiffElement>(diff.getOwnedElements());
</excerpt>
1) When I serialized the "match" and "diff" variables (to see the output),
how can I differentiate the changes?
2) I just need to know how can I get the values (e.g. add an element) from
the changes?
3) Do I need to use both "match" and "diff" to find the changes? I noticed
"match" has this similarity="1.0" attribute. Any tips?
Thanks
~nazir~
laurent Goubet wrote:
> Nazir,
> EMF Compare should work to compare XML schemas (see
> http://wiki.eclipse.org/Comparing_XML_files_with_EMF_Compare for
> comparison through the UI).
> As for using EMF Compare programmatically, we do have an example whoch
> can be accessed as described on the wiki at
>
http://wiki.eclipse.org/EMF_Compare_FAQ#How_can_I_use_EMF_Co mpare_programmatically.3F
> ..
> Cheers,
> Laurent Goubet
> Obeo
> Nazir a écrit :
>> Hi,
>>
>> I would like to know whether I differentiate between 2 XML schemas by
>> using the Compare framework. These 2 XML schemas will be like version 1
>> and version 2 but have the same name (some changes made), may be only
>> the top level schema without import elements etc.
>> In addition, is there any specific example on using this Compare
>> programmatically (without using the IDE)? If there's an example, it
>> would be more useful for me.
>>
>> Thanks
>> ~nazir~
>>
|
|
|
Re: EMF Compare - Comparing XSD (XML schema) [message #124774 is a reply to message #124762] |
Mon, 02 June 2008 08:30 |
|
This is a multi-part message in MIME format.
--------------040500050905060600090501
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
Nazir,
The values can be accessed directly from the DiffModel though I think
you'll need to convert it manually to suit your needs. C
|
|
|
|
Re: EMF Compare - Comparing XSD (XML schema) [message #619133 is a reply to message #123297] |
Mon, 02 June 2008 07:34 |
Muhamad Nazir Messages: 24 Registered: July 2009 |
Junior Member |
|
|
Thanks laurent for the answers. I already downloaded this sample:
"org.eclipse.emf.compare.examples.standalone". As I mentioned before, I'll
be using EMF Compare programmatically, I hope you can give me tips on
comparing XMLschema. I already put the same codes as:
<excerpt>
// Loading models
EObject model1 = ModelUtils.load(model1, resourceSet);
EObject model2 = ModelUtils.load(model2, resourceSet);
// Matching model elements
MatchModel match = MatchService.doMatch(model1, model2,
Collections.<String, Object> emptyMap());
// Computing differences
DiffModel diff = DiffService.doDiff(match, false);
// Merges all differences from model1 to model2
List<DiffElement> differences = new
ArrayList<DiffElement>(diff.getOwnedElements());
</excerpt>
1) When I serialized the "match" and "diff" variables (to see the output),
how can I differentiate the changes?
2) I just need to know how can I get the values (e.g. add an element) from
the changes?
3) Do I need to use both "match" and "diff" to find the changes? I noticed
"match" has this similarity="1.0" attribute. Any tips?
Thanks
~nazir~
laurent Goubet wrote:
> Nazir,
> EMF Compare should work to compare XML schemas (see
> http://wiki.eclipse.org/Comparing_XML_files_with_EMF_Compare for
> comparison through the UI).
> As for using EMF Compare programmatically, we do have an example whoch
> can be accessed as described on the wiki at
>
http://wiki.eclipse.org/EMF_Compare_FAQ#How_can_I_use_EMF_Co mpare_programmatically.3F
> ..
> Cheers,
> Laurent Goubet
> Obeo
> Nazir a écrit :
>> Hi,
>>
>> I would like to know whether I differentiate between 2 XML schemas by
>> using the Compare framework. These 2 XML schemas will be like version 1
>> and version 2 but have the same name (some changes made), may be only
>> the top level schema without import elements etc.
>> In addition, is there any specific example on using this Compare
>> programmatically (without using the IDE)? If there's an example, it
>> would be more useful for me.
>>
>> Thanks
>> ~nazir~
>>
|
|
|
Re: EMF Compare - Comparing XSD (XML schema) [message #619134 is a reply to message #124762] |
Mon, 02 June 2008 08:30 |
|
This is a multi-part message in MIME format.
--------------040500050905060600090501
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
Nazir,
The values can be accessed directly from the DiffModel though I think
you'll need to convert it manually to suit your needs. C
|
|
|
Powered by
FUDForum. Page generated in 0.03686 seconds