Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Serialize EMF Model using namespace prefix
Serialize EMF Model using namespace prefix [message #80098] Tue, 17 April 2007 19:05 Go to next message
Eclipse UserFriend
Originally posted by: dkrebs.tibco.com

Hi,
I'm trying to run an xml document built with emf with some xslt and its
getting thrown off because the xml document child elements do not contain
the namespace prefix, does anyone know how I can tell the emf serializer
to write the prefix on all elements when going from memory to filesystem?
Also the first element has the right prefix but it starts with a captial
character and I'm trying to figure out where to configure it to use a
lowercase instead of uppercase is that on the genmodel or ecore model?
regards- Duncan
Re: Serialize EMF Model using namespace prefix [message #80114 is a reply to message #80098] Tue, 17 April 2007 19:13 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------090707030108000506020303
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Duncan,

It's quite common for schemas to define local elements and attributes
that are not qualified and that's the default XMI serialization behavior
as well. You can use the annotations described in XML Schema to Ecore
Mapping
< http://www.eclipse.org/modeling/emf/docs/overviews/XMLSchema ToEcoreMapping.pdf>,
along with the XMLResource.OPTION_EXTENDED_META_DATA option so that the
annotations will be respected, to control how things are serialized
(element verses attribute, qualified verses unqualified) as well as the
actual XML names. You might want to write a small schema for the
serialization style you want and import it into Ecore to see how the
EAnnotations look and to generate the Java to see how the @model
annotations look.


Duncan Krebs wrote:
> Hi, I'm trying to run an xml document built with emf with some xslt
> and its getting thrown off because the xml document child elements do
> not contain the namespace prefix, does anyone know how I can tell the
> emf serializer to write the prefix on all elements when going from
> memory to filesystem? Also the first element has the right prefix but
> it starts with a captial character and I'm trying to figure out where
> to configure it to use a lowercase instead of uppercase is that on the
> genmodel or ecore model? regards- Duncan
>
>


--------------090707030108000506020303
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">
Duncan,<br>
<br>
It's quite common for schemas to define local elements and attributes
that are not qualified and that's the default XMI serialization
behavior as well. You can use the annotations described in <a
href=" http://www.eclipse.org/modeling/emf/docs/overviews/XMLSchema ToEcoreMapping.pdf">XML
Schema to Ecore Mapping</a>, along with the
XMLResource.OPTION_EXTENDED_META_DATA option so that the annotations
will be respected, to control how things are serialized (element verses
attribute, qualified verses unqualified) as well as the actual XML
names.
Re: Serialize EMF Model using namespace prefix [message #604807 is a reply to message #80098] Tue, 17 April 2007 19:13 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31562
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090707030108000506020303
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Duncan,

It's quite common for schemas to define local elements and attributes
that are not qualified and that's the default XMI serialization behavior
as well. You can use the annotations described in XML Schema to Ecore
Mapping
< http://www.eclipse.org/modeling/emf/docs/overviews/XMLSchema ToEcoreMapping.pdf>,
along with the XMLResource.OPTION_EXTENDED_META_DATA option so that the
annotations will be respected, to control how things are serialized
(element verses attribute, qualified verses unqualified) as well as the
actual XML names. You might want to write a small schema for the
serialization style you want and import it into Ecore to see how the
EAnnotations look and to generate the Java to see how the @model
annotations look.


Duncan Krebs wrote:
> Hi, I'm trying to run an xml document built with emf with some xslt
> and its getting thrown off because the xml document child elements do
> not contain the namespace prefix, does anyone know how I can tell the
> emf serializer to write the prefix on all elements when going from
> memory to filesystem? Also the first element has the right prefix but
> it starts with a captial character and I'm trying to figure out where
> to configure it to use a lowercase instead of uppercase is that on the
> genmodel or ecore model? regards- Duncan
>
>


--------------090707030108000506020303
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">
Duncan,<br>
<br>
It's quite common for schemas to define local elements and attributes
that are not qualified and that's the default XMI serialization
behavior as well. You can use the annotations described in <a
href=" http://www.eclipse.org/modeling/emf/docs/overviews/XMLSchema ToEcoreMapping.pdf">XML
Schema to Ecore Mapping</a>, along with the
XMLResource.OPTION_EXTENDED_META_DATA option so that the annotations
will be respected, to control how things are serialized (element verses
attribute, qualified verses unqualified) as well as the actual XML
names.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Serialize EMF Model using namespace prefix
Next Topic:[Teneo] Multivalued EAttributes of EDataTypes do not have the correct Hibernate mapping
Goto Forum:
  


Current Time: Fri Oct 30 20:23:32 GMT 2020

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

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

Back to the top