|Letting XSDEcoreBuilder reuse existing EPackages for imported schemas [message #603054]
||Wed, 11 June 2008 12:56
| Moritz Eysholdt
Registered: July 2009
Location: Kiel, Germany
I'm using the XSDEcoreBuilder to programmatically generate Ecore
packages from XSD files. In my scenario I have a couple of XSD files on
my hard drive and I want to have the derived EPackages in memory. The
XSDs can include/import each other.
The problem is that any XSD can change any time and I have to regenerate
the EPackages while keeping the effort at a minimum.
If one XSD changes, I already manage to reload it's XSDSchema model and
all depending XSDSchema models, so I always have the current XSDSchema
models in memory.
Regenerating the EPackages for all at once works perfectly, but how do I
prevent the XSDEcoreBuilder to regenerate Epackages that have already
been generated and are up to date?
- there are XSD A and XSD B, A imports B
- there are EPackages A and B generated from the XSDs
- A changes, I reload A and update B's referencingDirectives
- I want to regenerate EPackage A, but NOT EPackage B, since it didn't
change. How to I tell the XSDEcoreBuilder to reuse the existing EPackage B?
First I thought it might be possible by making EPackage B available via
the extendedMetaData's PackageRegistry, but it didn't seem to work out.
Then I noticed that an XSDSchema model's typeDefinition list also
contains all TypeDefinitions of included/imported XSDs... which
surprised me, since I expected to find only the ones that are defined in
that file. And since the XSDEcoreBuilder iterates over that list, this
explains why subpackages are always generated, too.
Powered by FUDForum
. Page generated in 0.06978 seconds