Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » UML to XML Transformation via qvto(qvto)
UML to XML Transformation via qvto [message #703348] Wed, 27 July 2011 13:29 Go to next message
Andreas Burger is currently offline Andreas BurgerFriend
Messages: 14
Registered: June 2011
Junior Member
Hello,

is it possible to transform an uml model in a xml file with qvto?
Our problem is to link the xsd metamodel in the qvto script. We can read in the uml-model but cannot reference to our specific xsd metamodel. Is it possible to reference to a specific local xsd metamodel?
For better appreciation see the example qvto script below.

modeltype XML uses 'metamodelfile.xsd';

modeltype UML uses '.../uml2/3.0.0/UML';(only short metamodel reference because of problem with link posting)




transformation uml2ecore ( in uml : UML, out xml : XML );

main ()
{
uml.objectsOfType ( Package ) -> map umlpackage2xml ( ) ;

}


mapping Package :: umlpackage2xml() : XML::Element
when { self.name = 'modelDeploymentView'; }
{

Re: UML to XML Transformation via qvto [message #703464 is a reply to message #703348] Wed, 27 July 2011 15:39 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26287
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
It sounds likely that you'd need to generate the Ecore model
corresponding to that XSD:<br>
<blockquote><a
href="http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.emf.doc/tutorials/xlibmod/xlibmod.html">Tutorial:
Generating an EMF Model using XML Schema</a><br>
</blockquote>
<br>
On 27/07/2011 6:29 AM, Andreas Burger wrote:
<blockquote cite="mid:j0p385$u29$1@news.eclipse.org" type="cite">Hello,
<br>
<br>
is it possible to transform an uml model in a xml file with qvto?
<br>
Our problem is to link the xsd metamodel in the qvto script. We
can read in the uml-model but cannot reference to our specific xsd
metamodel. Is it possible to reference to a specific local xsd
metamodel?
<br>
For better appreciation see the example qvto script below.
<br>
<br>
modeltype XML uses 'metamodelfile.xsd';
<br>
<br>
modeltype UML uses '.../uml2/3.0.0/UML';(only short metamodel
reference because of problem with link posting)
<br>
<br>
<br>
<br>
<br>
transformation uml2ecore ( in uml : UML, out xml : XML );
<br>
<br>
main ()
<br>
{
<br>
    uml.objectsOfType ( Package ) -&gt; map umlpackage2xml ( ) ;
<br>
<br>
}
<br>
<br>
<br>
mapping Package :: umlpackage2xml() : XML::Element
<br>
when { self.name = 'modelDeploymentView'; }
<br>
{
<br>
<br>
<br>
</blockquote>
</body>
</html>
Previous Topic:[ATL] Reusing transformation rules defined on an ecore model that is being extended
Next Topic:Performance issues w.r.t. QVTO compiler and interpreter
Goto Forum:
  


Current Time: Mon Dec 22 03:38:32 GMT 2014

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

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