Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » EMF Compare - Comparing XSD (XML schema)
EMF Compare - Comparing XSD (XML schema) [message #123073] Wed, 28 May 2008 03:05 Go to next message
Muhamad Nazir is currently offline Muhamad NazirFriend
Messages: 24
Registered: July 2009
Junior Member
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 #123297 is a reply to message #123073] Wed, 28 May 2008 10:05 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030809090106020001090209
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

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
Re: EMF Compare - Comparing XSD (XML schema) [message #124762 is a reply to message #123297] Mon, 02 June 2008 07:34 Go to previous messageGo to next message
Muhamad Nazir is currently offline Muhamad NazirFriend
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 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
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 #619013 is a reply to message #123073] Wed, 28 May 2008 10:05 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030809090106020001090209
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

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
Re: EMF Compare - Comparing XSD (XML schema) [message #619133 is a reply to message #123297] Mon, 02 June 2008 07:34 Go to previous message
Muhamad Nazir is currently offline Muhamad NazirFriend
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 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
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
Previous Topic:Are CDO Transactions transparent?
Next Topic:[EMF Compare] Innacuracies while comparing lists of very similar elements
Goto Forum:
  


Current Time: Thu Mar 28 16:37:41 GMT 2024

Powered by FUDForum. Page generated in 0.06305 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top