Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [wtp-dev] XML2EMF handling for ANY

What I had in mind was along these lines:

A strategy object that can be registered or passed in (by extension point or argument or whatever). Whenever translation hits an ANY or other similar situation where it doesn't know what to do but can ascertain that the XML is valid the strategy's handler is called. A default strategy could then be made available that follows the following steps:

1) The strategy has a list of registered dynamic translators that it can query with the specific ANY data (or perhaps an xpath to the ANY or some other way of identifying it). The first registered translator that volunteers then fills in the sub-tree comprised of the ANY with some externally linked EMF model.

2) If the strategy can find no such dynamic translator, it turns to a 'catch-all' translator that populates a feature map with dynamicEObject's.

The specific use case that is important to us (JSF) is that many elements of the application configuration file contain "extension" elements that are defined as ANY (JEE 1.4) or anyType (JEE5). These extensions are intended primarily to hold tool meta-data. In fact, the JSR276 meta-data standard proposes use this mechanism, so it will be value at some time in the future to be able integrate this data with the rest of our model.

--Cam

Jesper Steen Møller wrote:

Cameron Bateman wrote:

Has any work been done to support DTD ANY and XSD anyType data in the XML2EMF translators? If not, what is the current design thinking in this area?

I've thought a bit about its use.

xsd:anyType and friends would need special support in both EMF2SAX and EMF2DOM and cannot be added as "just another Translator", as some of the special types can.

But what kind of "any" support are you looking for?
- Introspective matching between the XML structure and the EMF model.
- Best effort mapping to a small, generic EMF model mimicking the XML structure - Serialization to/from some "real world" XML in-memory structure such as a DOM or a plain old string

Keep in mind that the Translator framework is both a structural description of the XML and the mapping to/from the EMF model. Without the Translator tree, you won't know how the XML tree maps to a tree of EMF objects/features.

-Jesper


--Cam
_______________________________________________
wtp-dev mailing list
wtp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/wtp-dev


_______________________________________________
wtp-dev mailing list
wtp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/wtp-dev




Back to the top