|Best way to extend XSD editor [message #595655]
||Tue, 14 June 2005 14:04
| Dave Bolt
Registered: July 2009
We need to build a set of plug-ins that are extensions to the built-in XSD |
editor. I'm looking for advice on how best to do the following:
We want to make use of the xs:annotation/xs:appinfo feature of XML schema to
embed some extra processing information into the schema. We will use these
additional machine-readable annotations to facilitate code generation logic
that is being built into other plugins on top of JDT. For an analogy for
what we are trying to accomplish, look at how JAXB can use inline XSD
annotations to provide customization of the generated JAXB binding classes.
Here is a high level use case.
The user would open an XML Schema XSD file using the XSD editor. The editor
and associated views would offer right-click menu options to add our
annotation tags to each customType and/or element in the XSD. The
implementation of the GUI would be similar to the Refactoring and Source
pop-up windows that you see in JDT.
We also want to add a background incremental builder that would "compile"
the XSD and add problem markers to all of the customTypes and elements that
are missing annotations.
The annotations themselves are bindings to other classes in our object model
and JAXB binding layer. The ultimate goal of the metadata is to help the
developer build a EJB session bean that reads data from an EJB entity
bean-based object model and write the data to a JAXB API derived from an XML
schema. A lot of this code is boilerplate in nature and could be generated
if we could map each customType/element to it's underlying EJB and
Does the XSD editor that you see in 3.0.x use EMF in the background to model
the structure of the document? Does this API fully support the annotation
features of the XML schema spec?
As an alternative approach we would use an external binding annotation
mechanism. We would design an XML schema that describes our binding
metadata. We would use EMF to build a custom editor for documents that
conform to this approach. To feed data to the editor we would run the XSD
file through a standard XSLT stylesheet to produce a derivative annotation
file that conforms to the EMF schema. This seems easier because I'm not
trying to shoehorn functionality into places where it might not fit.
So what do you think? What is the best fit for this type of problem?
Powered by FUDForum
. Page generated in 0.01652 seconds