Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » XSD Schema + Multiple Root Elements + EMF Editor leads to invalid XML file
XSD Schema + Multiple Root Elements + EMF Editor leads to invalid XML file [message #422705] Sun, 14 September 2008 11:56 Go to next message
Stefan Esterer is currently offline Stefan EstererFriend
Messages: 2
Registered: July 2009
Junior Member
Hi EMF-list...

I have searched my problem in this list but found no answer. So maybe you
could give me a hint where the problem with my approach lies.

I have a proper XML Schema[1] which defines two root elements (A and B).

I create an ecore model out of this xml schema and generate an editor for
it.

I start the editor and the wizard asks me for the 'model object' (I choose
B as my root element).

In the editor I can create a A element directly under the 'document root',
in other words as a sibling of element B.

This clearly leads to an invalid XML file. Even the EMF editor isn't able
to read the xml file after closing and trying to open it again.

So my conclusion is that you can create an invalid xml file with the EMF
editor. Is this a design decision, a bug or is there something I have
missed?

Thanks for your help...
Stefan Esterer

[1] http://nopaste.debianforum.de/11205
Re: XSD Schema + Multiple Root Elements + EMF Editor leads to invalid XML file [message #422706 is a reply to message #422705] Sun, 14 September 2008 13:16 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Stefan,

It's a good point. Not only does the editor allow you to do that, but
there's no constraint defined that enforces the rule that exactly and at
most one element-based feature of a document root must be set (and that
none of the attribute-based features may be set, for that matter).

Please open a bugzilla and I'll look into addressing both issues, a
constraint as well as respecting it in the editor, in 2.5.



Stefan Esterer wrote:
> Hi EMF-list...
>
> I have searched my problem in this list but found no answer. So maybe
> you could give me a hint where the problem with my approach lies.
>
> I have a proper XML Schema[1] which defines two root elements (A and B).
> I create an ecore model out of this xml schema and generate an editor
> for it.
>
> I start the editor and the wizard asks me for the 'model object' (I
> choose B as my root element).
>
> In the editor I can create a A element directly under the 'document
> root', in other words as a sibling of element B.
>
> This clearly leads to an invalid XML file. Even the EMF editor isn't
> able to read the xml file after closing and trying to open it again.
>
> So my conclusion is that you can create an invalid xml file with the
> EMF editor. Is this a design decision, a bug or is there something I
> have missed?
>
> Thanks for your help...
> Stefan Esterer
>
> [1] http://nopaste.debianforum.de/11205
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: XSD Schema + Multiple Root Elements + EMF Editor leads to invalid XML file [message #422711 is a reply to message #422706] Sun, 14 September 2008 17:23 Go to previous message
Stefan Esterer is currently offline Stefan EstererFriend
Messages: 2
Registered: July 2009
Junior Member
Hi..

Thx for your response. The bug for this problem is to be found under
https://bugs.eclipse.org/bugs/show_bug.cgi?id=247234

stefan esterer
Previous Topic:Adding a plain string to an AnyType FeatureMap (for Ed Merks)
Next Topic:How to get all the derived classes
Goto Forum:
  


Current Time: Thu Apr 25 14:47:04 GMT 2024

Powered by FUDForum. Page generated in 0.03489 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top