Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Extending the XSD metamodel
Extending the XSD metamodel [message #578207] Tue, 16 September 2003 13:45
Randall Hauch is currently offline Randall HauchFriend
Messages: 79
Registered: July 2009
Member
This is a multi-part message in MIME format.

------=_NextPart_000_0072_01C37C2E.EF8B75E0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I'd like to reuse the XSD metamodel by extending a few of the constructs =
(to add some new attributes), adding some of my own, and then =
restricting the use of others. This is very easy to do with other EMF =
generated metamodels. However, I'm running into a few issues.
1.. Because this is an extension, writing out to .xsd format is no =
longer an option. Luckily there's .xmi. Is there an easy way to read =
and write to XMI but still use the XSDResourceImpl (to keep all the =
benefits of that impl as the Resource)? XSDResourceImpl doesn't extend =
XMIResourceImpl or XMLResourceImpl.
2.. I'm running into a lot of difficulty with the item providers and =
(re)using the resource bundle for the XSD. I'm using a =
ComposedAdapterFactory to wrap the ItemProviderAdapterFactory instances =
for various metamodels. This approach has worked with the more than =
dozen EMF-generated metamodels, including when we have models that use a =
mixture of metamodels. This also works for a model when loaded from an =
..xsd file (that is, a model that only uses the XSD metamodel), but as =
soon as I open a model that uses my extended metamodel AND the XSD =
metamodel, then the ItemProviders don't seem to find the labels or they =
don't find the icons. (What's even more bizarre is that they icons and =
labels do show up correctly if the root object is an instance of an XSD =
metaclass, but if we try to create an instance of an XSD metaclass under =
one of our own, then there is a probem.) I suspect the problem is in my =
code, but is there something different about how XSD does it's icons and =
string localization (i18n) compared to normal EMF metamodels? One of my =
collegues is trying to generate an Editor for our metamodel to see if =
our generated providers work correctly that way.
Thanks in advance,

Randall Hauch
------=_NextPart_000_0072_01C37C2E.EF8B75E0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1226" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I'd like to reuse the XSD metamodel=20
by&nbsp;extending a few of the constructs (to add some new attributes), =
adding=20
some of my own, and then&nbsp;restricting&nbsp;the use of others.&nbsp; =
This is=20
very easy to do with other EMF generated metamodels.&nbsp; However, I'm =
running=20
into a few issues.</FONT></DIV>
<OL>
<LI><FONT face=3DArial size=3D2>Because this is an&nbsp;extension, =
writing out to=20
.xsd format is no longer an option.&nbsp; Luckily&nbsp;there's =
..xmi.&nbsp; Is=20
there&nbsp;an easy way to read and write to XMI but still use the=20
XSDResourceImpl (to keep all the benefits of that impl as the =
Resource)?&nbsp;=20
XSDResourceImpl doesn't extend XMIResourceImpl=20
or&nbsp;XMLResourceImpl.</FONT></LI>
<LI><FONT face=3DArial size=3D2>I'm running into a lot of difficulty =
with the item=20
providers and (re)using the resource bundle for the XSD.&nbsp; I'm =
using a=20
ComposedAdapterFactory to wrap the ItemProviderAdapterFactory =
instances for=20
various metamodels.&nbsp; This approach&nbsp;has worked with the more =
than=20
dozen&nbsp;EMF-generated metamodels, including when we have models =
that use a=20
mixture of metamodels.&nbsp; This also&nbsp;works for a model when =
loaded from=20
an .xsd file (that is, a model that only uses the XSD metamodel), but =
as soon=20
as I open a model that uses my extended metamodel AND the XSD =
metamodel, then=20
the ItemProviders don't seem to find the labels or they don't find the =

icons.&nbsp; (What's even more bizarre is that they icons and labels =
do show=20
up correctly if the root object is an instance of an XSD metaclass, =
but if we=20
try to create an instance of an XSD metaclass under one of our own, =
then there=20
is a probem.)&nbsp; I suspect the problem is in my code, but is there=20
something different about how XSD does it's icons and string =
localization=20
(i18n) compared to normal EMF metamodels?&nbsp; One of my collegues is =
trying=20
to generate an Editor for our metamodel to see if&nbsp;our generated =
providers=20
work correctly that way.</FONT></LI></OL>
<DIV><FONT face=3DArial size=3D2>Thanks in advance,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Randall =
Hauch</FONT></DIV></BODY></HTML>

------=_NextPart_000_0072_01C37C2E.EF8B75E0--
Previous Topic:comparing XSDTypeDefinitions
Next Topic:Extending the XSD metamodel
Goto Forum:
  


Current Time: Sun Aug 09 18:58:08 GMT 2020

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

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

Back to the top