|
Re: Serializing and deserializing EPackages [message #418347 is a reply to message #418343] |
Mon, 14 April 2008 11:01 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------060004060409040301060706
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Eike,
Comments below.
Eike Stepper wrote:
> Hi,
>
> I have a local package registry in a resource set and I need to
> serialize some packages to an XMI string.
Can you do ePackage.eResource().save(System.out, null)?
> Simply adding the EPackage instances to XMIResources in a separate
> ResourceSet doesn't seem to do the trick. References between the
> packages are serialized like:
>
> <?xml version="1.0" encoding="ASCII"?>
> <ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="model2"
> nsURI="http://www.eclipse.org/emf/CDO/tests/model2/1.0.0"
> nsPrefix="model2">
> <eClassifiers xsi:type="ecore:EClass" name="SpecialPurchaseOrder">
> <eSuperTypes href=_*"../model1/1.0.0#//PurchaseOrder"*_/>
There's nothing wrong with that is there?
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="discountCode">
> <eType xsi:type="ecore:EDataType"
> href="../../../2002/Ecore#//EString"/>
I wonder what the URI of the resource from which this was saved was?
All references will be made relative to that URI. Note that you can use
OPTION_URI_HANDLER to control how and whether URIs are made relative...
> </eStructuralFeatures>
> </eClassifiers>
> </ecore:EPackage>
>
> Any hints are greatly appreciated
>
> Cheers
> /Eike
>
>
>
--------------060004060409040301060706
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Eike,<br>
<br>
Comments below.<br>
<br>
Eike Stepper wrote:
<blockquote cite="mid:ftv6t9$78h$1@build.eclipse.org" type="cite">Hi,<br>
<br>
I have a local package registry in a resource set and I need to
serialize some packages to an XMI string. </blockquote>
Can you do ePackage.eResource().save(System.out, null)?<br>
<blockquote cite="mid:ftv6t9$78h$1@build.eclipse.org" type="cite">Simply
adding the EPackage
instances to XMIResources in a separate ResourceSet doesn't seem to do
the trick. References between the packages are serialized like:<br>
<br>
<?xml version="1.0" encoding="ASCII"?><br>
<ecore:EPackage xmi:version="2.0" xmlns:xmi=<a moz-do-not-send="true"
class="moz-txt-link-rfc2396E" href="http://www.omg.org/XMI">"http://www.omg.org/XMI"</a>
xmlns:xsi=<a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a>
xmlns:ecore=<a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
href="http://www.eclipse.org/emf/2002/Ecore">"http://www.eclipse.org/emf/2002/Ecore"</a>
name="model2"
nsURI=<a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
href="http://www.eclipse.org/emf/CDO/tests/model2/1.0.0">"http://www.eclipse.org/emf/CDO/tests/model2/1.0.0"</a>
nsPrefix="model2"><br>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02478 seconds