Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » substitution group revisited
substitution group revisited [message #421507] Fri, 08 August 2008 08:30 Go to next message
Andrew H is currently offline Andrew HFriend
Messages: 117
Registered: July 2009
Senior Member
Ed

I know this is an issue that has been dealt with before
( http://dev.eclipse.org/mhonarc/newsLists/news.eclipse.tools. emf/msg29000.html
) but I'm pulling my hair out trying to get it to work.

I followed the instructions in your blog
http://ed-merks.blogspot.com/2007/12/winters-icy-grip.html

and this fixed the first problem. I know get a decent Java model out of
the schema without the ugly FeatureMap's

However, I still can't serialize / deserialize with substitution groups.
Its still stuck with xsi:type.

I've noticed that every subtitution group element that is defined in all
the schemas has ended up in one Ecore class called FPML. Is that normal?

Any advice on how I go about debugging this?

Also is there any option other than adding the
ecore:ignoreSubstitutionGroups="true"? As these are industry standard
schemas I would have preferred not to have had to edit them.

regards

Andrew
Re: substitution group revisited [message #421520 is a reply to message #421507] Fri, 08 August 2008 12:12 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070808090206080102060802
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Andrew,

Commetns below.

Andrew H wrote:
> Ed
>
> I know this is an issue that has been dealt with before
> ( http://dev.eclipse.org/mhonarc/newsLists/news.eclipse.tools. emf/msg29000.html
>
> ) but I'm pulling my hair out trying to get it to work.
Careful. This can lead to premature permanent hair loss.
>
> I followed the instructions in your blog
> http://ed-merks.blogspot.com/2007/12/winters-icy-grip.html
>
> and this fixed the first problem. I know get a decent Java model out
> of the schema without the ugly FeatureMap's
>
> However, I still can't serialize / deserialize with substitution
> groups. Its still stuck with xsi:type.
Did you include the right options for deducing the group while serializing?

/**
* This option is used to specify an {@link ElementHandler} for
deducing the feature used to serialize a specific type of value.
* @see ElementHandler
* @since 2.4
*/
String OPTION_ELEMENT_HANDLER = "ELEMENT_HANDLER";

>
> I've noticed that every subtitution group element that is defined in
> all the schemas has ended up in one Ecore class called FPML. Is that
> normal?
Global elements end up in the document root class and it's possible for
that class to be renamed to any name you choose with an
ecore:documentRoot annotation on the <xsd:schema> element.
>
> Any advice on how I go about debugging this?
Check the options uses when serializing.
>
> Also is there any option other than adding the
> ecore:ignoreSubstitutionGroups="true"? As these are industry standard
> schemas I would have preferred not to have had to edit them.
There's a bugzilla about being able to annotate a schema with
annotations external to the schema, but I'm having a hard time keeping
up with all the things people desire...
>
> regards
>
> Andrew
>
>

--------------070808090206080102060802
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">
Andrew,<br>
<br>
Commetns below.<br>
<br>
Andrew H wrote:
<blockquote
cite="mid:2d1651aca465202c5650c454c930c9c4$1@www.eclipse.org"
type="cite">Ed
<br>
<br>
I know this is an issue that has been dealt with before
(<a class="moz-txt-link-freetext" href=" http://dev.eclipse.org/mhonarc/newsLists/news.eclipse.tools. emf/msg29000.html"> http://dev.eclipse.org/mhonarc/newsLists/news.eclipse.tools. emf/msg29000.html</a>
<br>
) but I'm pulling my hair out trying to get it to work.
<br>
</blockquote>
Careful. This can lead to premature permanent hair loss.<br>
<blockquote
cite="mid:2d1651aca465202c5650c454c930c9c4$1@www.eclipse.org"
type="cite"><br>
I followed the instructions in your blog
<a class="moz-txt-link-freetext" href="http://ed-merks.blogspot.com/2007/12/winters-icy-grip.html">http://ed-merks.blogspot.com/2007/12/winters-icy-grip.html</a>
<br>
<br>
and this fixed the first problem. I know get a decent Java model out of
the schema without the ugly FeatureMap's
<br>
<br>
However, I still can't serialize / deserialize with substitution
groups. Its still stuck with xsi:type.
<br>
</blockquote>
Did you include the right options for deducing the group while
serializing?<small><br>
</small>
<blockquote><small>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: substitution group revisited [message #421700 is a reply to message #421520] Tue, 12 August 2008 05:51 Go to previous message
Andrew H is currently offline Andrew HFriend
Messages: 117
Registered: July 2009
Senior Member
Turns out I was using the wrong factory. I had based my test code on the
EMF doco and was using the XMLResourceFactoryImpl

In the end I ran the generate test code and looked at what it used and saw
it was using the generated factory. i.e. I had changed the generated
factory but wasn't running the test with it cause I didn't understand the
connection.

Works now

thanks

Andrew

Ed Merks wrote:

> Andrew,

> Commetns below.

> Andrew H wrote:
>> Ed
>>
>> I know this is an issue that has been dealt with before
>>
( http://dev.eclipse.org/mhonarc/newsLists/news.eclipse.tools. emf/msg29000.html
>>
>> ) but I'm pulling my hair out trying to get it to work.
> Careful. This can lead to premature permanent hair loss.
>>
>> I followed the instructions in your blog
>> http://ed-merks.blogspot.com/2007/12/winters-icy-grip.html
>>
>> and this fixed the first problem. I know get a decent Java model out
>> of the schema without the ugly FeatureMap's
>>
>> However, I still can't serialize / deserialize with substitution
>> groups. Its still stuck with xsi:type.
> Did you include the right options for deducing the group while serializing?

> /**
> * This option is used to specify an {@link ElementHandler} for
> deducing the feature used to serialize a specific type of value.
> * @see ElementHandler
> * @since 2.4
> */
> String OPTION_ELEMENT_HANDLER = "ELEMENT_HANDLER";

>>
>> I've noticed that every subtitution group element that is defined in
>> all the schemas has ended up in one Ecore class called FPML. Is that
>> normal?
> Global elements end up in the document root class and it's possible for
> that class to be renamed to any name you choose with an
> ecore:documentRoot annotation on the <xsd:schema> element.
>>
>> Any advice on how I go about debugging this?
> Check the options uses when serializing.
>>
>> Also is there any option other than adding the
>> ecore:ignoreSubstitutionGroups="true"? As these are industry standard
>> schemas I would have preferred not to have had to edit them.
> There's a bugzilla about being able to annotate a schema with
> annotations external to the schema, but I'm having a hard time keeping
> up with all the things people desire...
>>
>> regards
>>
>> Andrew
>>
>>
Previous Topic:how to generate the <package>Validator class
Next Topic:Map and ecore
Goto Forum:
  


Current Time: Thu Apr 25 06:07:50 GMT 2024

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

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

Back to the top