Namespace information lost in reference [message #1150149] |
Tue, 22 October 2013 15:23 |
Robert Neßelrath Messages: 14 Registered: April 2013 |
Junior Member |
|
|
Hi,
I have a problem with an ecore-model generated from a xml-schema. The source-schema is for the speech synthesis markup language ssml. I took the xsd-files, generated a model and generated editor code for this model. With the generated ssml-editor everything works fine. Here an example of the code:
<?xml version="1.0" encoding="UTF-8"?>
<speech_synthesis:speak xmlns:speech_synthesis="http://www.w3.org/2001/10/synthesis">this is a<speech_synthesis:s>test</speech_synthesis:s></speech_synthesis:speak>
You can see, that here the namespace information for all elements is available. Now I tried to add the DocumentRoot class of this generated model to another model, by defining a reference. The result of the file, created by the editor is now this one:
<presentation xsi:type="io:SpeechSynthesis" device="speaker" modality="speech" language="de-DE">
<ssmlDocument>
<speak>
this is a
<s>
test
<s/>
</speak>
</ssmlDocument>
</presentation>
You can see that the namespace information is missing. This is not only a problem for me, it makes it impossible to reload this file into the editor:
org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 's' not found.
Any idea how to solve this issue?
Thanks a lot,
Robert
[Updated on: Tue, 22 October 2013 15:29] Report message to a moderator
|
|
|
Re: Namespace information lost in reference [message #1150232 is a reply to message #1150149] |
Tue, 22 October 2013 16:34 |
Ed Merks Messages: 33217 Registered: July 2009 |
Senior Member |
|
|
Robert,
Comments below.
On 22/10/2013 5:23 PM, Robert Neßelrath wrote:
> Hi,
>
> I have a problem with an ecore-model generated from a xml-schema. The
> source-schema is for the speech synthesis markup language ssml. I took
> the xsd-files, generated a model and generated editor code for this
> model. With the generated ssml-editor everything works fine. Here an
> example of the code:
> <?xml version="1.0" encoding="UTF-8"?>
> <speech_synthesis:speak
> xmlns:speech_synthesis="http://www.w3.org/2001/10/synthesis">this is
> a<speech_synthesis:s>test</speech_synthesis:s></speech_synthesis:speak>
>
> You can see, that here the namespace information for all elements is
> available. Now I tried to add the DocumentRoot class of this generated
> model to another model, by defining a reference.
Hmm. That doesn't really make sense if you want some well formed XML
that conforms to the schema.... In XML Schema you'd refer to some
global element of another schema, so you need to do something that
matches this approach.
> The result of the file, created by the editor is now this one:
>
> <presentation xsi:type="io:SpeechSynthesis" device="speaker"
> modality="speech" language="de-DE" utterance="Willkommen beim
> Sprach-Browser von BMW">
> <ssmlDocument>
> <speak>
> this is a <s>
> test
> <s/>
> </speak>
> </ssmlDocument>
> </presentation>
>
> You can see that the namespace information is missing. This is not
> only a problem for me, it makes it impossible to reload this file into
> the editor:
> org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 's' not
> found.
Yes, it's all not sensible.
>
> Any idea how to solve this issue?
Are you writing this other model directly in Ecore? Better you write a
small schema instead (even export your Ecore's corresponding *.genmodel
to an XML Schema and ensure that you use a global element from your
other schema or use a complex type from your other schema. Don't use
the DocumentRoot like this. It only functions, as the name implies, as
the root object in a resource/document...
> Thanks a lot,
> Robert
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03691 seconds