|
|
Re: Is it possible to save more than one object in one resource? [message #513251 is a reply to message #513250] |
Tue, 09 February 2010 14:09 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------090301060003020405010606
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Tom,
Exactly. For this reason it's only possible with XMIResourceImpl; in
that case, when there are multiple roots, a "fake" XMI root element is
used to hold them.
Tom Schindl wrote:
> Not at the root because XML-Files can only hold one Object as
> Root-Element. An XML-File like this is invalid:
>
> <?xml version='1.0'>
> <test></test>
> <test></test>
>
> Tom
>
> Am 09.02.10 14:57, schrieb Jens Dürr:
>
>> Hi all,
>>
>> I'm trying to save more than one model object in one resource, but only
>> the first added content gets serialized.
>>
>> The model is genereated from xml schema, so the used resource is a
>> subclass of XmlResource.
>>
>> After reading the docs I thought this should be possible.
>>
>> Greetings Jens
>>
>
>
--------------090301060003020405010606
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Tom,<br>
<br>
Exactly. For this reason it's only possible with XMIResourceImpl; in
that case, when there are multiple roots, a "fake" XMI root element is
used to hold them.<br>
<br>
<br>
Tom Schindl wrote:
<blockquote cite="mid:hkrq39$gds$1@build.eclipse.org" type="cite">
<pre wrap="">Not at the root because XML-Files can only hold one Object as
Root-Element. An XML-File like this is invalid:
<?xml version='1.0'>
<test></test>
<test></test>
Tom
Am 09.02.10 14:57, schrieb Jens Dürr:
</pre>
<blockquote type="cite">
<pre wrap="">Hi all,
I'm trying to save more than one model object in one resource, but only
the first added content gets serialized.
The model is genereated from xml schema, so the used resource is a
subclass of XmlResource.
After reading the docs I thought this should be possible.
Greetings Jens
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
</body>
</html>
--------------090301060003020405010606--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
|
Re: Is it possible to save more than one object in one resource? [message #514444 is a reply to message #514378] |
Mon, 15 February 2010 11:31 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Petr,
Comments below.
Petr Kalafatic wrote:
> Hi,
> I have similar problem.
> I have one main data model (feature A)
> and second model (feature B) is used just for adding objects to main
> model (both are loaded from one resource)
> Features must be independent-they just know the path to the real model
> file (no dependency between plugins).
> Any idea to solve it in other way ?
You're trying to put both objects in one resource? Either you put them
both at the root, and then you can't use XMLResourceImpl, or you create
a container object that's able to hold both and you put that one
container at the root of the resource.
> Thank you,
> Petr
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03183 seconds