|Re: How to fill AnyType mixed content with Java code [message #1123054 is a reply to message #1122582]
||Wed, 02 October 2013 06:30
| Ed Merks
Registered: July 2009
On 01/10/2013 8:33 PM, Robert Neßelrath wrote:
> I need to programmatically fill the mixed content of an AnyType
> Element. The Model is generated from a xml schema and contains mixed
> html content, e.g.:
> this is <a href=link" title="title"/> an example
> I've already found out, how to fill the text element:
You've looked at
and at http://www.eclipse.org/modeling/emf/docs/overviews/FeatureMap.pdf?
> I am still searching for a solution for the inner anchor-tag. Somehow
> I have to create an EReference instance
One doesn't already exist? A wildcard is involved.
> and add this together with another FeatureMap as value to the
> anyType.getMixed() - feature map.
That doesn't make sense. A FeatureMap can't be a value of an entry.
> The second feature map is then filled with the attribute values. I am
> facing two problems:
> 1. How can I instantiate the second Feature map?
You can't. You can instantiate an EObject, e.g., an AnyType instance
that holds a feature map, but you can't just instantiate a feature map
> 2. How to create a correct EReference-instance, that correctly works
> with this feature map?
If one doesn't already exist, you can demand create one. Have a look at
the first article. I'm sure you'll get the idea.
> Thank you very much !
Powered by FUDForum
. Page generated in 0.01474 seconds