Community
Participate
Working Groups
For processing of XML files it would be nice to have a metamodel implementation based on XSD schema files. For XML files that apply to the schema this metamodel an instantiator is needed.
Ecore has this feature. So from my point of view, this is invalid
Bernd, you are thinking about the XSD2Ecore facility? Yes, that's a way to transfer the XSD to Ecore and then work upon the generated Ecore metamodel. Reason for this feature request is a) the generation of the resulting .ecore metamodel is an additional step and has to be done each time the .xsd changes b) the importer is not documented well. I searched and tried a while and finally manged to get it working. OK, we could provide the links to the docs and explain the process in an additional article to make this task easier for those searching for it. c) How are then XML documents read and instantiated into this Ecore metamodel? I haven't found it, please help. d) It would be nice if the editors will reflect directly the schema.
Why not just convert the xsd to ecore? Karsten, please close if this has been solved.
Created attachment 80873 [details] Dynamic EMF Example with XSD I've created a small example that shows how a .ecore metamodel can be instantiated in memory based on an XSD Schema. Afterwards, a XML file that is valid to the schema is used to instantiate a dynamic emf model. It contains german documentation though. If somebody wants it in english, let me know.
Created attachment 83656 [details] XMLReader workflow component This is an early version of oAW workflow comonent that takes a XML file and one or more XML Schemas and transforms them into dynamic Ecore Packages. The file contains an example project, too. This is not a complete solution to the problem yet as the actual oAW metamodel implementation is still missing. It is possible to generate code with Xpand already, but typenames are not converted correctly and the Eclipse Xpand editor is not metamodelaware for XML Schema metamodels. /** * This workflow component loads an XML file into a dynamic Ecore model. * * The XML format has to be specified via one or more XML Schemas. They are * transformed into dynamic eEore packages which are then uses as metamodels. * * Example: <code> * <component class="org.eclipse.mwe.xsd.XMLReader"> * <modelSlot value="model" /> * <uri value="src/model/wash.xml" /> * <xmlSchema value="src/model/loadcurve.xsd" /> * <xmlSchema value="src/model/device.xsd" /> * <useSingleGlobalResourceSet value="true" /> * </component> * </code> * * @author moritz@eysholdt.de * */
Created attachment 87946 [details] oAW XSD Adapter rev99 My implementation of the oAW XSD Adapter made quite some progress. It allows to use XSDs as meta models without having do deal with EMF/Ecore. This works within workflows and the xpand editor (meta model aware code completion) The archive contains: - the feature and plugins, ready to be copied to an Eclipse installation. - the source - demos - documentation For more details, see the documentaion inside the archive or at: http://softeys.de/oaw-xsd-adapter/doc/contents/xsd_tutorial.html This is still an early version, but ready to be tried out...
Created attachment 87978 [details] oAW XSD Adapter rev102 now compiled for java5 (rev99 was for java6)
Created attachment 89944 [details] oAW XSD Adapter rev20080217 Changes: - fix: if no type mapping is available for sub typs of EDataTypes, a mapping based on the EDatatype's implementation Class is now used. That should work for the vast majority of cases. - feature: XMLWriter allows to write a modified/created model back to an XML file. - demo: There is a demo now that how to generate an ecore model from an XSD via genmodel and then use the ecore as meta model for the XMLReader. This way the xsd2ecore transformation can be configured more fine grained. - demo: Read a XML file that is based on a custom XSD and apply a model 2 model transformation to create a SVG image. The image is then stored to XML via XMLWriter. - feature: Support for XML mixed content via EMF FeatureMaps. But there is still a bug related to caching mechanism in other parts of oAW, which causes trouble if you want to create new Objects that are supposed to contain mixed content.
Created attachment 90091 [details] oAW XSD Adapter rev20080219 changes: - feature: support for type QName
Created attachment 90178 [details] oAW XSD Adapter rev20080220 changes: - fix: meta model package names containing dots are now reduced to their last segment.
Created attachment 90521 [details] oAW XSD Adapter rev20080222 Changes: - fix: The QName type was not resolved correctly when requested by name
Created attachment 95009 [details] oAW XSD Adapter rev20080406 changes: - Feature: Support for EMaps. - Feature: Support for creating DocumentRoot Objects using Xtend. This way, custom namespaces, namespaceprefixes and schemalocations can be added to an XML file. - Fix: Rewritten locater for XSD files. They can be referenced by the workflow file, schemalocations within XML files or imports within other schemas. The lookup is done relative to the referee first, then delegated to the default oAW resource locator. This way the lookup is done in the classpath and in the pluginpath, too. - Feature: The XMLWriter now supports to write multiple files at once. A oAW Expression can be used to specify a filename for each file. - Demo: There is a new demo which shows how to generate multiple XSD files from one ecore model, which contains multiple subpackages. The Demo shows how set up custom namespaces in a m2m transformation and how to generate multiple XML files at once. - A couple of minor bugfixes.
I forgot to metion that to create DocumentRoot objects you will need the latest nightly build of oAW (http://oawbranch.pluginbuilder.org/latest/) or you will have to wait until oAW 4.3 is released: http://www.peterfriese.de/openarchitectureware-43-to-be-released-in-april-2008/
Created attachment 96999 [details] oAW XSD Adapter rev20080422 changes: - fix: increased the XSDMetaModelContributor's performance a lot - fix: With many open projects the XSDMetaModelContributor's ProjectAnalyzer sometimes ended up in a deadlock - fix: If types declared within an XSD changes, the EmfRegistryMetaModel's type-resolving-cache prevented them from being reloaded properly. Now the XSDMetaModel (which is a subtype of EmfRegistryMetaModel) is instantiated new if needed.
Created attachment 100924 [details] oAW XSD Adapter rev20080519 changes: - fix: xsd-include is now supported properly.
Created attachment 101280 [details] oAW XSD Adapter rev20080521 changes: - fix: Names of EPackages that are based on multiple schemas which include each other are calculated correctly now.
Created attachment 101749 [details] oAW XSD Adapter rev20080523 changes: - feature: Added public Xtend-API to invoke the XMLReader. If one XML file contains references to other ones, then they can be loaded dynamically from within Xtend/Xpand now.
Created attachment 106015 [details] oAW XSD Adapter rev20080627 changes: - fix: when schemas change, are removed or moved within a project, they and their dependent schemas are reloaded properly - fix: when multiple schemas depend on the same second schema, the second schema is only loaded once - feature: loading schemas and generating EPackages for them is now done by a custom eclipse builder - feature: added an oAW-type for EFeature - feature: EClasses now exhibit their EFeatures as constant properties - feature: made all important operations of EFeatureMaps available -> support for xsd:any and xsd:anyAttribute - fix: EFeatureMaps and EFeatureMapEntries can now be accessed via name - feature: made the XMLResource's options accessible for the XMLReader and XMLWriter - feature: added option for XMLReader to define a default namespace for XML files - feature: added option for XMLReader to define namespace mapping known issues: - sometimes on startup there is no full build triggered and Xpand/Xtend editors therefore complain about missing types. triggering the build manually helps. - if projects are closed schemas/EPackages are not unloaded correctly. - if there are diagnostic issues from the XMLResource or the XSDEcoreBuilder or if there are name conflicts between elements/attributes, they are now printed while running a workflow. this might be verbose, but as long as your workflow finishes with the desired result, don't be scared.
Created attachment 106106 [details] oAW XSD Adapter rev20080630 changes: - fix: on start up there is always a full build triggered now - fix: if a project is closed, the contained XSDs are unloaded now
Created attachment 106315 [details] oAW XSD Adapter rev20080702 changes: - feature: added a news2xhtml demo. - feature: added support for composed simple xsd types.
Created attachment 111308 [details] oAW XSD Adapter latest The XSD Adapter has been integrated into oAW's nightly build, so this bug can be closed. For the latest info about the XSD Adapter see: http://www.openarchitectureware.org/staticpages/index.php/xsd_adapter regards, Moritz
This bug has been moved to www.openArchitectureWare.org/bugzilla. This action is part of a batch process. We apologize if you received many mails due to this action. After change of the resolution the bugs will be closed.
This bug has been moved to www.openArchitectureWare.org/bugzilla. This action is part of a batch process. We apologize if you received many mails due to this action.