Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » XML input to ecore
XML input to ecore [message #873428] Fri, 18 May 2012 08:05 Go to next message
Kosala Yapa is currently offline Kosala YapaFriend
Messages: 159
Registered: September 2010
Senior Member
Hi there,
The input for the source model(ecore) is xml and output from the target model(ecore) is xmi. Transformation is written in ATL.

Source: XML->ecore model
Transformation: ATL
Target: ecore ->xmi

Step1) I have xml input file(data.xml):

<?xml version="1.0"?>
<DeviceItem
Name="ppp1"
IsSelected="false"

<ModuleList>
<ModuleItem
Name="m1"
IsSelected="false"
ModuleReference="Rm1">
</ModuleItem>
<ModuleItem
Name="m2"
IsSelected="false"
ModuleReference="Rm2">
</ModuleItem>
<ModuleItem
Name="m3"
IsSelected="false"
ModuleReference="Rm3">
</ModuleItem>
<ModuleItem
Name="m4"
IsSelected="false"
ModuleReference="Rm4">
</ModuleItem>
</ModuleList>

</DeviceItem>

Step2) I created XML schema for this input file and then created ecore model using eclipse EMF project(source model).

Step3)I created another ecore model(target model) and wrote the transformation in ATL.


Error: Error loading data.xml: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'null' not found.

Can someone find/hint how to solve this issue?

Thanks in advance
Kosala
Re: XML input to ecore [message #873433 is a reply to message #873428] Fri, 18 May 2012 08:15 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26235
Registered: July 2009
Senior Member
Kosala,

If your package is one that corresponds to XML schema without a
targetNamespace (which appears to be the case, given there are no
namespace in your XML), it's important that you register the generated
XyzResourceFactoryImpl to handle reading of your data file.


On 18/05/2012 10:05 AM, Kosala Mising name wrote:
> Hi there,
> The input for the source model(ecore) is xml and output from the
> target model(ecore) is xmi. Transformation is written in ATL.
>
> Source: XML->ecore model
> Transformation: ATL
> Target: ecore ->xmi
>
> Step1) I have xml input file(data.xml):
>
> <?xml version="1.0"?>
> <DeviceItem Name="ppp1" IsSelected="false"
> <ModuleList> <ModuleItem Name="m1"
> IsSelected="false" ModuleReference="Rm1"> </ModuleItem>
> <ModuleItem Name="m2" IsSelected="false"
> ModuleReference="Rm2"> </ModuleItem> <ModuleItem
> Name="m3" IsSelected="false"
> ModuleReference="Rm3">
> </ModuleItem> <ModuleItem Name="m4"
> IsSelected="false" ModuleReference="Rm4"> </ModuleItem>
> </ModuleList>
>
> </DeviceItem>
>
> Step2) I created XML schema for this input file and then created ecore
> model using eclipse EMF project(source model).
>
> Step3)I created another ecore model(target model) and wrote the
> transformation in ATL.
>
>
> Error: Error loading data.xml:
> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
> 'null' not found.
>
> Can someone find/hint how to solve this issue?
>
> Thanks in advance
> Kosala
Previous Topic:Example Hello World - Acceleo - M2T
Next Topic:[Acceleo]I don't want to chang the timestamp when the content is not changed
Goto Forum:
  


Current Time: Fri Nov 28 02:01:13 GMT 2014

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

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