Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » XMI Serialization with ns-prefix
XMI Serialization with ns-prefix [message #1038136] Wed, 10 April 2013 12:55 Go to next message
Robert Neßelrath is currently offline Robert NeßelrathFriend
Messages: 14
Registered: April 2013
Junior Member
Hello together,

I actually spent several hours in order to find a solution, how to add a namespace-prefix to emf serialization. All I get is the following code

<?xml version="1.0" encoding="UTF-8"?>
<dialogue:Dialogue xmi:version="2.0" ... xmlns:pattern="dfki.de/iui/mmds/core/model/pattern" id="speech_test">
  <content xsi:type="flowchart:Sequence" id="sequence1">
    <variables xsi:type="dialogue:Variable" name="name" type="">
  
    </variables>
    <content xsi:type="flowchart:While" condition="true">
      <body xsi:type="flowchart:Sequence">
        <content xsi:type="dialogue:ExecutableContentNode" id="frage_name" displayName="frage_name">
          <content xsi:type="dialogue:Send">
            <outputRequest xsi:type="io:OutputAct">
              <presentation xsi:type="io:SpeechSynthesis" device="speaker" utterance="Hallo, wie heißt du?"/>
            </outputRequest>
          </content>
        </content>
        <content xsi:type="flowchart:WaitForEvent" id="me_llamo" displayName="me llamo">
          <event xsi:type="dialogue:CondEvent" event="InputEvent">
            <pattern xsi:type="pattern:PObject" instIdx="-1">
              <slot xsi:type="pattern:PSlot">


My problem is that the content of the type-attributes use namespace-prefixes but the tags do not. E.g. at the last line the tag-name should be "pattern:slot". I read a lot of documents and found out, that you somehow can change the behaviour of the serializer with 'qualified'-annotations but I cannot find out how. Is there some kind of option that tells the serializer to use namespace prefixes by default.

Thanks in advance,
Robert
Re: XMI Serialization with ns-prefix [message #1039390 is a reply to message #1038136] Fri, 12 April 2013 05:36 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33107
Registered: July 2009
Senior Member
Robert,

Comments below.

On 11/04/2013 2:37 PM, Robert Neßelrath wrote:
> Hello together,
>
> I actually spent several hours in order to find a solution, how to add
> a namespace-prefix to emf serialization. All I get is the following code
>
> <?xml version="1.0" encoding="UTF-8"?>
> <dialogue:Dialogue xmi:version="2.0" ...
> xmlns:pattern="dfki.de/iui/mmds/core/model/pattern" id="speech_test">
> <content xsi:type="flowchart:Sequence" id="sequence1">
> <variables xsi:type="dialogue:Variable" name="name" type="">
>
> </variables>
> <content xsi:type="flowchart:While" condition="true">
> <body xsi:type="flowchart:Sequence">
> <content xsi:type="dialogue:ExecutableContentNode"
> id="frage_name" displayName="frage_name">
> <content xsi:type="dialogue:Send">
> <outputRequest xsi:type="io:OutputAct">
> <presentation xsi:type="io:SpeechSynthesis"
> device="speaker" utterance="Hallo, wie heißt du?"/>
> </outputRequest>
> </content>
> </content>
> <content xsi:type="flowchart:WaitForEvent" id="me_llamo"
> displayName="me llamo">
> <event xsi:type="dialogue:CondEvent" event="InputEvent">
> <pattern xsi:type="pattern:PObject" instIdx="-1">
> <slot xsi:type="pattern:PSlot">
>
> My problem is that the content of the type-attributes use
> namespace-prefixes but the tags do not. E.g. at the last line the
> tag-name should be "pattern:slot". I read a lot of documents and found
> out, that you somehow can change the behaviour of the serializer with
> 'qualified'-annotations but I cannot find out how. Is there some kind
> of option that tells the serializer to use namespace prefixes by default.
It's hard to imagine why an XMI serialization would require
nsPrefixes... The element name is sufficient to identify the feature
name. In any case, you'd have to fuss with extended meta data
annotations like what you have in a model when you start with an XML Schema.
>
> Thanks in advance,
> Robert


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: XMI Serialization with ns-prefix [message #1039559 is a reply to message #1039390] Fri, 12 April 2013 09:46 Go to previous messageGo to next message
Robert Neßelrath is currently offline Robert NeßelrathFriend
Messages: 14
Registered: April 2013
Junior Member
Thank you. Your answer strengthens me in my assumption that in XMI namespaces aren't necessary. Now I have to convince my project partner Wink
A manual annotation of the model is no option for me, because the models are too huge.
Re: XMI Serialization with ns-prefix [message #1039643 is a reply to message #1039559] Fri, 12 April 2013 11:45 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33107
Registered: July 2009
Senior Member
Robert,

In XMI, the prefixes are only necessary to identity the package of
something (via the package's nsURI). That's only necessary for the root
element and for xsi/xmi:types. Nested elements and attributes can
always just use simple names that correspond to the names of features.


On 12/04/2013 11:46 AM, Robert Neßelrath wrote:
> Thank you. Your answer strengthens me in my assumption that in XMI
> namespaces aren't necessary. Now I have to convince my project partner ;)
> A manual annotation of the model is no option for me, because the
> models are too huge.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[xcore] Is creating the model in multiple files possible?
Next Topic:[xsd2ecore] defaultValueLiteral issue with required strings
Goto Forum:
  


Current Time: Tue Mar 19 03:39:51 GMT 2024

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

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

Back to the top