Book a Demo

Author Topic: Merge error: Root Package in XML doesn't match the selected package in the model  (Read 3540 times)

KaikuK

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Hello,

I have two almost identical XSD files, but with some key differences. I would like to merge them into one file, so that there would not be any duplicate items.

I have tried the following approach:
1.   Import both XSD files separately and transform them into a class model
2.   Transform both class models into database models (DDL)
3.   Export one of them into XMI file
4.   Try to use the merge function as described here to combine them together (https://sparxsystems.com/enterprise_architect_user_guide/14.0/model_publishing/merge_package_directly.html)

However, when we do this we face an error “Root Package in XML does not match the selected package in the model” (The same error was described here but never received answer on how to fix it https://www.sparxsystems.com/forums/smf/index.php?topic=38951.0)
Is this approach functional in order to merge the files without duplicating anything and if so what is causing the error and how can you fix it?
If the approach itself is flawed, is there a way to merge models without duplication?

Cheers for help!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
As far as EA is concerned those two packages are unrelated.

I'm not sure if you can do anything to change that. XSD import doesn't perform a synchronization, you'll end up with a new package with new elements each time. The transforms act on specific elements identified by guids. The package merge operates on unique items specified by guids.

One possible solution would be to modify the DDL transform template (or create a new one) so that you use the full form of the TRANSFORM_REFERENCE, then transform one to the same package as the first after exporting the XMI for the first.

https://www.sparxsystems.com/enterprise_architect_user_guide/15.1/model_domains/crossreferences2.html

My thought is that instead of:
Code: [Select]
%TRANSFORM_REFERENCE("Table")%You could try:
Code: [Select]
%TRANSFORM_REFERENCE(className, className)%
I'm not sure you're going to get anything useful out after performing two transformations anyway.

Wouldn't it be easier to perform a text merge on the two files?