Flexible XML editing [message #1832873] |
Mon, 28 September 2020 11:27 |
Patrick Neubauer Messages: 4 Registered: May 2017 |
Junior Member |
|
|
Hello!
We are working on extending the Flexmi editor (i.e. a reflective textual syntax editor for EMF models) [1] with content assistance capabilities.
Flexmi employs fuzzy matching to map XML tags to instances of EClasses in the target metamodel. The following line in the Flexmi file (i.e. a XML file) indicates to which Ecore it is supposed to conform. For example, the following line indicates that the Flexmi model instantiates the Ecore metamodel "myecore.ecore":
Although the Flexmi editor extends the org.eclipse.ui.editors.text.TextEditor class, this is not a requirement. It may extend the org.eclipse.wst.sse.ui.StructuredTextEditor instead.
Any suggestions or hints on which steps it may involve when extending an existing WTP/WST editor for XML instances that represent (flexible) instances conforming to a specific Ecore file are much appreciated--thanks!
Cheers
Patrick
[1] https://www.eclipse.org/epsilon/doc/flexmi/
[Updated on: Mon, 28 September 2020 11:35] Report message to a moderator
|
|
|
|
Re: Flexible XML editing [message #1832933 is a reply to message #1832897] |
Tue, 29 September 2020 16:16 |
Patrick Neubauer Messages: 4 Registered: May 2017 |
Junior Member |
|
|
Dear Nitin,
thank you for your response. This is already helpful.
Let me try to better explain Flexmi [1,2].
Flexmi documents are essentially valid XML documents which only differ in their file extension (.flexmi as opposed to .xml). Flexmi documents are instances of an Ecore file/metamodel and associated through a specific tag pointing to the Ecore it is supposed to conform to.
One of the main differences of the Flexmi editor (i.e. when compared with XML editors) is that names of tags and attributes do not necessarily have to match the exact names of EClasses and EAttributes to successfully construct a metamodel-conforming in-memory model or XMI file. For example, a metamodel defining an EClass named "Task" containing EAttributes named "title" and "duration" can be specified as follows and still be parsed as a correct instance of the EClass named "Task":
<task title="Do the laundry" dur="3"></task>
Therefore, in regards to content assistance, we are looking to provide/inherit the same capability as the Eclipse XML editor offers for XML documents that specify their association to a XML Schema (i.e. an Ecore metamodel in case of Flexmi), however, also account for flexibly named elements and attributes.
Which approaches do you see that could implement such behavior?
Cheers
Patrick
[1] http://ceur-ws.org/Vol-1694/FlexMDE2016_paper_3.pdf
[2] https://www.eclipse.org/epsilon/doc/flexmi/
[Updated on: Tue, 29 September 2020 21:41] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.01519 seconds