Change xml scema? [message #115404] |
Thu, 29 March 2007 11:24  |
Eclipse User |
|
|
|
Originally posted by: john.blutarsky.hotmail.com
Hello everyone,
I was wondering if it would be possible to change the scehma of the xml
files that are created when using my GMF editor?
If so how could this be done?
Thank you,
John
|
|
|
|
Re: Change xml scema? [message #115428 is a reply to message #115404] |
Thu, 29 March 2007 11:44   |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
This is a multi-part message in MIME format.
--------------040003060907000907030302
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
John,
If you are looking to specialize the serialization of your instance
data, this document describes annotations you can use on the Ecore model
to direct how serialization and deserialization will work:
< http://www.eclipse.org/modeling/emf/docs/overviews/XMLSchema ToEcoreMapping.pdf>
http://www.eclipse.org/modeling/emf/docs/overviews/XMLSchema ToEcoreMapping.pdf
You'll need to be sure your resource factory used options like this:
public Resource createResource(URI uri)
{
XMLResource result = new LibraryResourceImpl(uri);
*
result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTEND ED_META_DATA,
Boolean.TRUE);*
*
result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTEND ED_META_DATA,
Boolean.TRUE);*
result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA _LOCATION,
Boolean.TRUE);
result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_EN CODED_ATTRIBUTE_STYLE,
Boolean.TRUE);
result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_EN CODED_ATTRIBUTE_STYLE,
Boolean.TRUE);
result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LE XICAL_HANDLER,
Boolean.TRUE);
return result;
}
EMF should generate a resource factory for you once your model contains
extended meta data annotations but you'll probably have to change your
GenPackage's "Resource Type" property to "XML" (and keep in mind that
since plugin.xml doesn't support merge, the normal plugin.xml
registration for the generated factory won't just show up unless you
delete the plugin.xml and regenerate it.
John Bluto wrote:
> Hello everyone,
>
> I was wondering if it would be possible to change the scehma of the
> xml files that are created when using my GMF editor?
>
> If so how could this be done?
>
> Thank you,
>
> John
>
--------------040003060907000907030302
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">
John,<br>
<br>
If you are looking to specialize the serialization of your instance
data, this document describes annotations you can use on the Ecore
model to direct how serialization and deserialization will work:<a
href=" http://www.eclipse.org/modeling/emf/docs/overviews/XMLSchema ToEcoreMapping.pdf"><br>
</a>
<blockquote><a
href=" http://www.eclipse.org/modeling/emf/docs/overviews/XMLSchema ToEcoreMapping.pdf"> http://www.eclipse.org/modeling/emf/docs/overviews/XMLSchema ToEcoreMapping.pdf</a><br>
</blockquote>
You'll need to be sure your resource factory used options like this:<br>
<blockquote><small>
|
|
|
|
Powered by
FUDForum. Page generated in 0.17936 seconds