|
Re: Resolving "non-containment" EReference's [message #52397 is a reply to message #52341] |
Mon, 27 October 2008 16:59 |
Paul Elder Messages: 849 Registered: July 2009 |
Senior Member |
|
|
Morten:
I'm not sure what is going on. A bit more information would be useful:
1) Can you include the ECore model used?
2) How was that ECore model generated? (e.g. created directly, modeled in
project xxx, created from an XSD)
One important point to remember about JET is that, when dealing with
EMF-based models, JET IS NOT READING the XML/XMI directly. Instead, it uses
EMF to load the XML/XMI into memory as EObjects. JET then uses EMF's
reflective capabilities to map EReference and EAttribute features to XPath
concepts such as element and attribute.
From what I can deduce from about your meta-model, the folllowing XPath
expression SHOULD produce the result 'Brick2':
/documentRoot/bricksDiagram/bricks[@name = 'Brick1']/relatedBrick/@name
However, the existence of an element named 'documentRoot' makes me
suspicious that your ECore model was developed from an XSD. (EMF creates a
class called DocumentRoot in such cases - it represents the XML Document
object.) If that is the case, then it is even more confusing to then see the
XML document serialized into XMI - this typically shouldn't be done -
JET/EMF will have difficulty loading the document again (and making sense of
its contents). The one place were I have seen this happen has been in GMF
generated editors, which seem to serial via XMI, even if the ECore package
provides an other serialization mechanism.
Can you provide a bit more information?
Paul
|
|
|
Re: Resolving "non-containment" EReference's [message #52744 is a reply to message #52397] |
Wed, 29 October 2008 19:50 |
Morten Madsen Messages: 2 Registered: July 2009 |
Junior Member |
|
|
Hi, and thanks a lot for your answer :-).
I can understand you are a bit confused. The <documentRoot> tag is a
coincidence. I always create a <root> tag on my ecore's. Old habit, think
it's something about when you want to serialize the model, or use it
together with GMF.
The model instance in my question is created using a GMF editor, generated
from my ecore model. It is therefore fed to the transformation as a flat
XML file. I've removed the namespaces in the input XML, and renamed it
from ".bricksmodel" to ".xml".
Else I think the transformation will not accept the model, and I will get
a "property 'version' not found" in case i don't remove the
namespaces..... have you encountered this error before?
Come to think of it, renaming the extension of the model might make it
unable to recognize the EMF model, and on top of that, I'm not sure the
I've registered the model properly.
I'll make some tests and get back to you. I'm unable to access my install
of Rational Software modeler / Eclipse at the moment.
Thanks again,
Morten.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03860 seconds