Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Next issue...
Next issue... [message #32350] Wed, 29 October 2003 16:46 Go to next message
Lance Phillips is currently offline Lance PhillipsFriend
Messages: 210
Registered: July 2009
Senior Member
Ed,
Here's the next issue I've run into with the xsd code. We have a
metamodel for simple data types that we save in a regular xmi resource not
an xsd resource due to the fact that we've added properties that make our
model not a valid xsd. When I set a baseType using the following mechanism
sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini tion(( "string"),
I get the correct XSDSimpleTypeDefinition back. However, when I try to save
the xmi resource, I get a hanging href exception due to the fact that the
returned type does not exist in a resource.

Any help??
Re: Next issue... [message #32386 is a reply to message #32350] Wed, 29 October 2003 17:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

--------------2BE391B1C15B028E92C37BCE
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Lance,

Remember that resolveXyz will always return something, but it may be an
unattached placeholder, i.e., getContainer() == null. The following should be
true for what you show below:

sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini tion( "string").getSchema()
== sdt.getSchema().getSchemaForSchema()

Lance Phillips wrote:

> Ed,
> Here's the next issue I've run into with the xsd code. We have a
> metamodel for simple data types that we save in a regular xmi resource not
> an xsd resource due to the fact that we've added properties that make our
> model not a valid xsd. When I set a baseType using the following mechanism
> sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini tion(( "string"),
> I get the correct XSDSimpleTypeDefinition back. However, when I try to save
> the xmi resource, I get a hanging href exception due to the fact that the
> returned type does not exist in a resource.
>
> Any help??

--------------2BE391B1C15B028E92C37BCE
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Lance,
<p>Remember that resolveXyz will <b>always</b> return something, but it
may be an unattached placeholder, i.e., getContainer() == null.&nbsp;&nbsp;
The following should be true for what you show below:
<blockquote> sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini tion( "string").getSchema()
== sdt.getSchema().getSchemaForSchema()</blockquote>

<p><br>Lance Phillips wrote:
<blockquote TYPE=CITE>Ed,
<br>&nbsp;&nbsp;&nbsp; Here's the next issue I've run into with the xsd
code.&nbsp; We have a
<br>metamodel for simple data types that we save in a regular xmi resource
not
<br>an xsd resource due to the fact that we've added properties that make
our
<br>model not a valid xsd.&nbsp; When I set a baseType using the following
mechanism
<br> sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini tion(( "string"),
<br>I get the correct XSDSimpleTypeDefinition back.&nbsp; However, when
I try to save
<br>the xmi resource, I get a hanging href exception due to the fact that
the
<br>returned type does not exist in a resource.
<p>Any help??</blockquote>
</html>

--------------2BE391B1C15B028E92C37BCE--
Re: Next issue... [message #32420 is a reply to message #32386] Wed, 29 October 2003 20:48 Go to previous messageGo to next message
Lance Phillips is currently offline Lance PhillipsFriend
Messages: 210
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

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

Let me go after this a different way... How exactly am I supposed to =
look up an entity in an XSDResource? I know I want the root entity =
NMTOKENS... But if I use the resourceSet to go after that entity with =
correctly formed URI I get nothing. I'm stepping into the getEObject =
method in XSDResourceImpl and it is trying to go after the entity via =
DOM. It seems like if I ask an EOjbect for its URI (which is how I =
figured out what URI to pass into my call), I should be able to turn =
around and ask the resource set for that EObject using that same URI. =
But that does not work!!

I have loaded the xml.xsd for the schema of schemas into and XSD =
resource and registered the uri for that resource via the URI Converter =
on my resource set. Everything seems to be working fine except for the =
lookup I mention above. I'm really stumped.

thanks,

lp
"Ed Merks" <merks@ca.ibm.com> wrote in message =
news:3F9FFFB9.2210B7CD@ca.ibm.com...
Lance,=20
Remember that resolveXyz will always return something, but it may be =
an unattached placeholder, i.e., getContainer() =3D=3D null. The =
following should be true for what you show below:=20

=
sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini tion( "string"=
).getSchema() =3D=3D sdt.getSchema().getSchemaForSchema()

Lance Phillips wrote:=20

Ed,=20
Here's the next issue I've run into with the xsd code. We have =
a=20
metamodel for simple data types that we save in a regular xmi =
resource not=20
an xsd resource due to the fact that we've added properties that =
make our=20
model not a valid xsd. When I set a baseType using the following =
mechanism=20
=
sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini tion(( "string=
"),=20
I get the correct XSDSimpleTypeDefinition back. However, when I try =
to save=20
the xmi resource, I get a hanging href exception due to the fact =
that the=20
returned type does not exist in a resource.=20
Any help??

------=_NextPart_000_0009_01C39E2B.A6291B40
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.1264" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Let me go after this a different =
way...&nbsp; How=20
exactly am I supposed to look up an entity in an XSDResource?&nbsp; I =
know I=20
want the root entity NMTOKENS... But if I use the resourceSet to go =
after that=20
entity with correctly formed URI I get nothing.&nbsp; I'm stepping into =
the=20
getEObject method in XSDResourceImpl and it is trying to go after the =
entity via=20
DOM.&nbsp; It seems like if I ask an EOjbect for its URI (which is how I =
figured=20
out what URI to pass into my call), I should be able to turn around and =
ask the=20
resource set&nbsp;for that EObject using that same URI.&nbsp; But that =
does not=20
work!!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have loaded the xml.xsd for the =
schema of schemas=20
into and XSD resource and registered the uri for that resource via the =
URI=20
Converter on my resource set.&nbsp; Everything seems to be working fine =
except=20
for the lookup I mention above.&nbsp; I'm really stumped.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>lp</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A =
href=3D"mailto:merks@ca.ibm.com">merks@ca.ibm.com</A>&gt;=20
wrote in message <A=20
=
href=3D"news:3F9FFFB9.2210B7CD@ca.ibm.com">news:3F9FFFB9.2210B7CD@ca.ibm.=
com</A>...</DIV>Lance,=20

<P>Remember that resolveXyz will <B>always</B> return something, but =
it may be=20
an unattached placeholder, i.e., getContainer() =3D=3D =
null.&nbsp;&nbsp; The=20
following should be true for what you show below:=20
=
<BLOCKQUOTE> sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini t=
ion("string").getSchema()=20
=3D=3D sdt.getSchema().getSchemaForSchema()</BLOCKQUOTE>
<P><BR>Lance Phillips wrote:=20
<BLOCKQUOTE TYPE=3D"CITE">Ed, <BR>&nbsp;&nbsp;&nbsp; Here's the next =
issue=20
I've run into with the xsd code.&nbsp; We have a <BR>metamodel for =
simple=20
data types that we save in a regular xmi resource not <BR>an xsd =
resource=20
due to the fact that we've added properties that make our <BR>model =
not a=20
valid xsd.&nbsp; When I set a baseType using the following mechanism =

=
<BR> sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini tion(( "st=
ring"),=20
<BR>I get the correct XSDSimpleTypeDefinition back.&nbsp; However, =
when I=20
try to save <BR>the xmi resource, I get a hanging href exception due =
to the=20
fact that the <BR>returned type does not exist in a resource.=20
<P>Any help??</P></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0009_01C39E2B.A6291B40--
Re: Next issue... [message #32455 is a reply to message #32420] Wed, 29 October 2003 22:07 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

--------------B5BF9722A45B3BD241B6CF8A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Lance,

If I understand the problem correctly (you haven't shown me the URI ;-)
you have URI references to things in the Schema for Schemas. This
schema is treated as a singleton by the XSD model and that one instance
lives in its own resource set, namely
XSDSchemaImpl.getGlobalResourceSet. If you need a resource set that
resolves URIs to this instance, you can override
ResourceSetImpl.delegatedGetResource to call getResource (with false
demand load!) on this global resource set.


Lance Phillips wrote:

> Let me go after this a different way... How exactly am I supposed to
> look up an entity in an XSDResource? I know I want the root entity
> NMTOKENS... But if I use the resourceSet to go after that entity with
> correctly formed URI I get nothing. I'm stepping into the getEObject
> method in XSDResourceImpl and it is trying to go after the entity via
> DOM. It seems like if I ask an EOjbect for its URI (which is how I
> figured out what URI to pass into my call), I should be able to turn
> around and ask the resource set for that EObject using that same URI.
> But that does not work!! I have loaded the xml.xsd for the schema of
> schemas into and XSD resource and registered the uri for that resource
> via the URI Converter on my resource set. Everything seems to be
> working fine except for the lookup I mention above. I'm really
> stumped. thanks, lp
>
> "Ed Merks" <merks@ca.ibm.com> wrote in message
> news:3F9FFFB9.2210B7CD@ca.ibm.com...Lance,
>
> Remember that resolveXyz will always return something, but
> it may be an unattached placeholder, i.e., getContainer() ==
> null. The following should be true for what you show
> below:
>
> sdt.ge
> Schema().getSchemaForSchema().resolveSimpleTypeDefinition("string ").getSchema()
> == sdt.getSchema().getSchemaForSchema()
>
>
> Lance Phillips wrote:
>
> > Ed,
> > Here's the next issue I've run into with the xsd
> > code. We have a
> > metamodel for simple data types that we save in a regular
> > xmi resource not
> > an xsd resource due to the fact that we've added
> > properties that make our
> > model not a valid xsd. When I set a baseType using the
> > following mechanism
> > sdt.getSchema().get
> > chemaForSchema().resolveSimpleTypeDefinition(("string"),
> > I get the correct XSDSimpleTypeDefinition back. However,
> > when I try to save
> > the xmi resource, I get a hanging href exception due to
> > the fact that the
> > returned type does not exist in a resource.
> >
> > Any help??
>

--------------B5BF9722A45B3BD241B6CF8A
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<body bgcolor="#FFFFFF">
Lance,
<p>If I understand the problem correctly (you haven't shown me the URI
;-) you have URI references to things in the Schema for Schemas.&nbsp;
This schema is treated as a singleton by the XSD model and that one instance
lives in its own resource set, namely XSDSchemaImpl.getGlobalResourceSet.&nbsp;
If you need a resource set that resolves URIs to this instance, you can
override ResourceSetImpl.delegatedGetResource to call getResource (with
false demand load!) on this global resource set.
<br>&nbsp;
<p>Lance Phillips wrote:
<blockquote TYPE=CITE><style></style>
<font face="Arial"><font size=-1>Let
me go after this a different way...&nbsp; How exactly am I supposed to
look up an entity in an XSDResource?&nbsp; I know I want the root entity
NMTOKENS... But if I use the resourceSet to go after that entity with correctly
formed URI I get nothing.&nbsp; I'm stepping into the getEObject method
in XSDResourceImpl and it is trying to go after the entity via DOM.&nbsp;
It seems like if I ask an EOjbect for its URI (which is how I figured out
what URI to pass into my call), I should be able to turn around and ask
the resource set for that EObject using that same URI.&nbsp; But that does
not work!!</font></font>&nbsp;<font face="Arial"><font size=-1>I have loaded
the xml.xsd for the schema of schemas into and XSD resource and registered
the uri for that resource via the URI Converter on my resource set.&nbsp;
Everything seems to be working fine except for the lookup I mention above.&nbsp;
I'm really stumped.</font></font>&nbsp;<font face="Arial"><font size=-1>thanks,</font></font>&nbsp;<font face="Arial"><font size=-1>lp</font></font>
<blockquote dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">"Ed
Merks" &lt;<a href="mailto:merks@ca.ibm.com">merks@ca.ibm.com</a>> wrote
in message <a href="news:3F9FFFB9.2210B7CD@ca.ibm.com">news:3F9FFFB9.2210B7CD@ca.ibm.com</a>...Lance,
<p>Remember that resolveXyz will <b>always</b> return something, but it
may be an unattached placeholder, i.e., getContainer() == null.&nbsp;&nbsp;
The following should be true for what you show below:
<blockquote> sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini tion( "string").getSchema()
== sdt.getSchema().getSchemaForSchema()</blockquote>

<p><br>Lance Phillips wrote:
<blockquote TYPE="CITE">Ed,
<br>&nbsp;&nbsp;&nbsp; Here's the next issue I've run into with the xsd
code.&nbsp; We have a
<br>metamodel for simple data types that we save in a regular xmi resource
not
<br>an xsd resource due to the fact that we've added properties that make
our
<br>model not a valid xsd.&nbsp; When I set a baseType using the following
mechanism
<br> sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini tion(( "string"),
<br>I get the correct XSDSimpleTypeDefinition back.&nbsp; However, when
I try to save
<br>the xmi resource, I get a hanging href exception due to the fact that
the
<br>returned type does not exist in a resource.
<p>Any help??</blockquote>
</blockquote>
</blockquote>

</body>
</html>

--------------B5BF9722A45B3BD241B6CF8A--
Re: Next issue... [message #580231 is a reply to message #32350] Wed, 29 October 2003 17:58 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31469
Registered: July 2009
Senior Member
--------------2BE391B1C15B028E92C37BCE
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Lance,

Remember that resolveXyz will always return something, but it may be an
unattached placeholder, i.e., getContainer() == null. The following should be
true for what you show below:

sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini tion( "string").getSchema()
== sdt.getSchema().getSchemaForSchema()

Lance Phillips wrote:

> Ed,
> Here's the next issue I've run into with the xsd code. We have a
> metamodel for simple data types that we save in a regular xmi resource not
> an xsd resource due to the fact that we've added properties that make our
> model not a valid xsd. When I set a baseType using the following mechanism
> sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini tion(( "string"),
> I get the correct XSDSimpleTypeDefinition back. However, when I try to save
> the xmi resource, I get a hanging href exception due to the fact that the
> returned type does not exist in a resource.
>
> Any help??

--------------2BE391B1C15B028E92C37BCE
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Lance,
<p>Remember that resolveXyz will <b>always</b> return something, but it
may be an unattached placeholder, i.e., getContainer() == null.&nbsp;&nbsp;
The following should be true for what you show below:
<blockquote> sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini tion( "string").getSchema()
== sdt.getSchema().getSchemaForSchema()</blockquote>

<p><br>Lance Phillips wrote:
<blockquote TYPE=CITE>Ed,
<br>&nbsp;&nbsp;&nbsp; Here's the next issue I've run into with the xsd
code.&nbsp; We have a
<br>metamodel for simple data types that we save in a regular xmi resource
not
<br>an xsd resource due to the fact that we've added properties that make
our
<br>model not a valid xsd.&nbsp; When I set a baseType using the following
mechanism
<br> sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini tion(( "string"),
<br>I get the correct XSDSimpleTypeDefinition back.&nbsp; However, when
I try to save
<br>the xmi resource, I get a hanging href exception due to the fact that
the
<br>returned type does not exist in a resource.
<p>Any help??</blockquote>
</html>

--------------2BE391B1C15B028E92C37BCE--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Next issue... [message #580258 is a reply to message #32386] Wed, 29 October 2003 20:48 Go to previous message
Lance Phillips is currently offline Lance PhillipsFriend
Messages: 210
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

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

Let me go after this a different way... How exactly am I supposed to =
look up an entity in an XSDResource? I know I want the root entity =
NMTOKENS... But if I use the resourceSet to go after that entity with =
correctly formed URI I get nothing. I'm stepping into the getEObject =
method in XSDResourceImpl and it is trying to go after the entity via =
DOM. It seems like if I ask an EOjbect for its URI (which is how I =
figured out what URI to pass into my call), I should be able to turn =
around and ask the resource set for that EObject using that same URI. =
But that does not work!!

I have loaded the xml.xsd for the schema of schemas into and XSD =
resource and registered the uri for that resource via the URI Converter =
on my resource set. Everything seems to be working fine except for the =
lookup I mention above. I'm really stumped.

thanks,

lp
"Ed Merks" <merks@ca.ibm.com> wrote in message =
news:3F9FFFB9.2210B7CD@ca.ibm.com...
Lance,=20
Remember that resolveXyz will always return something, but it may be =
an unattached placeholder, i.e., getContainer() =3D=3D null. The =
following should be true for what you show below:=20

=
sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini tion( "string"=
).getSchema() =3D=3D sdt.getSchema().getSchemaForSchema()

Lance Phillips wrote:=20

Ed,=20
Here's the next issue I've run into with the xsd code. We have =
a=20
metamodel for simple data types that we save in a regular xmi =
resource not=20
an xsd resource due to the fact that we've added properties that =
make our=20
model not a valid xsd. When I set a baseType using the following =
mechanism=20
=
sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini tion(( "string=
"),=20
I get the correct XSDSimpleTypeDefinition back. However, when I try =
to save=20
the xmi resource, I get a hanging href exception due to the fact =
that the=20
returned type does not exist in a resource.=20
Any help??

------=_NextPart_000_0009_01C39E2B.A6291B40
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.1264" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Let me go after this a different =
way...&nbsp; How=20
exactly am I supposed to look up an entity in an XSDResource?&nbsp; I =
know I=20
want the root entity NMTOKENS... But if I use the resourceSet to go =
after that=20
entity with correctly formed URI I get nothing.&nbsp; I'm stepping into =
the=20
getEObject method in XSDResourceImpl and it is trying to go after the =
entity via=20
DOM.&nbsp; It seems like if I ask an EOjbect for its URI (which is how I =
figured=20
out what URI to pass into my call), I should be able to turn around and =
ask the=20
resource set&nbsp;for that EObject using that same URI.&nbsp; But that =
does not=20
work!!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have loaded the xml.xsd for the =
schema of schemas=20
into and XSD resource and registered the uri for that resource via the =
URI=20
Converter on my resource set.&nbsp; Everything seems to be working fine =
except=20
for the lookup I mention above.&nbsp; I'm really stumped.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>lp</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A =
href=3D"mailto:merks@ca.ibm.com">merks@ca.ibm.com</A>&gt;=20
wrote in message <A=20
=
href=3D"news:3F9FFFB9.2210B7CD@ca.ibm.com">news:3F9FFFB9.2210B7CD@ca.ibm.=
com</A>...</DIV>Lance,=20

<P>Remember that resolveXyz will <B>always</B> return something, but =
it may be=20
an unattached placeholder, i.e., getContainer() =3D=3D =
null.&nbsp;&nbsp; The=20
following should be true for what you show below:=20
=
<BLOCKQUOTE> sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini t=
ion("string").getSchema()=20
=3D=3D sdt.getSchema().getSchemaForSchema()</BLOCKQUOTE>
<P><BR>Lance Phillips wrote:=20
<BLOCKQUOTE TYPE=3D"CITE">Ed, <BR>&nbsp;&nbsp;&nbsp; Here's the next =
issue=20
I've run into with the xsd code.&nbsp; We have a <BR>metamodel for =
simple=20
data types that we save in a regular xmi resource not <BR>an xsd =
resource=20
due to the fact that we've added properties that make our <BR>model =
not a=20
valid xsd.&nbsp; When I set a baseType using the following mechanism =

=
<BR> sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini tion(( "st=
ring"),=20
<BR>I get the correct XSDSimpleTypeDefinition back.&nbsp; However, =
when I=20
try to save <BR>the xmi resource, I get a hanging href exception due =
to the=20
fact that the <BR>returned type does not exist in a resource.=20
<P>Any help??</P></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0009_01C39E2B.A6291B40--
Re: Next issue... [message #580282 is a reply to message #32420] Wed, 29 October 2003 22:07 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31469
Registered: July 2009
Senior Member
--------------B5BF9722A45B3BD241B6CF8A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Lance,

If I understand the problem correctly (you haven't shown me the URI ;-)
you have URI references to things in the Schema for Schemas. This
schema is treated as a singleton by the XSD model and that one instance
lives in its own resource set, namely
XSDSchemaImpl.getGlobalResourceSet. If you need a resource set that
resolves URIs to this instance, you can override
ResourceSetImpl.delegatedGetResource to call getResource (with false
demand load!) on this global resource set.


Lance Phillips wrote:

> Let me go after this a different way... How exactly am I supposed to
> look up an entity in an XSDResource? I know I want the root entity
> NMTOKENS... But if I use the resourceSet to go after that entity with
> correctly formed URI I get nothing. I'm stepping into the getEObject
> method in XSDResourceImpl and it is trying to go after the entity via
> DOM. It seems like if I ask an EOjbect for its URI (which is how I
> figured out what URI to pass into my call), I should be able to turn
> around and ask the resource set for that EObject using that same URI.
> But that does not work!! I have loaded the xml.xsd for the schema of
> schemas into and XSD resource and registered the uri for that resource
> via the URI Converter on my resource set. Everything seems to be
> working fine except for the lookup I mention above. I'm really
> stumped. thanks, lp
>
> "Ed Merks" <merks@ca.ibm.com> wrote in message
> news:3F9FFFB9.2210B7CD@ca.ibm.com...Lance,
>
> Remember that resolveXyz will always return something, but
> it may be an unattached placeholder, i.e., getContainer() ==
> null. The following should be true for what you show
> below:
>
> sdt.ge
> Schema().getSchemaForSchema().resolveSimpleTypeDefinition("string ").getSchema()
> == sdt.getSchema().getSchemaForSchema()
>
>
> Lance Phillips wrote:
>
> > Ed,
> > Here's the next issue I've run into with the xsd
> > code. We have a
> > metamodel for simple data types that we save in a regular
> > xmi resource not
> > an xsd resource due to the fact that we've added
> > properties that make our
> > model not a valid xsd. When I set a baseType using the
> > following mechanism
> > sdt.getSchema().get
> > chemaForSchema().resolveSimpleTypeDefinition(("string"),
> > I get the correct XSDSimpleTypeDefinition back. However,
> > when I try to save
> > the xmi resource, I get a hanging href exception due to
> > the fact that the
> > returned type does not exist in a resource.
> >
> > Any help??
>

--------------B5BF9722A45B3BD241B6CF8A
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<body bgcolor="#FFFFFF">
Lance,
<p>If I understand the problem correctly (you haven't shown me the URI
;-) you have URI references to things in the Schema for Schemas.&nbsp;
This schema is treated as a singleton by the XSD model and that one instance
lives in its own resource set, namely XSDSchemaImpl.getGlobalResourceSet.&nbsp;
If you need a resource set that resolves URIs to this instance, you can
override ResourceSetImpl.delegatedGetResource to call getResource (with
false demand load!) on this global resource set.
<br>&nbsp;
<p>Lance Phillips wrote:
<blockquote TYPE=CITE><style></style>
<font face="Arial"><font size=-1>Let
me go after this a different way...&nbsp; How exactly am I supposed to
look up an entity in an XSDResource?&nbsp; I know I want the root entity
NMTOKENS... But if I use the resourceSet to go after that entity with correctly
formed URI I get nothing.&nbsp; I'm stepping into the getEObject method
in XSDResourceImpl and it is trying to go after the entity via DOM.&nbsp;
It seems like if I ask an EOjbect for its URI (which is how I figured out
what URI to pass into my call), I should be able to turn around and ask
the resource set for that EObject using that same URI.&nbsp; But that does
not work!!</font></font>&nbsp;<font face="Arial"><font size=-1>I have loaded
the xml.xsd for the schema of schemas into and XSD resource and registered
the uri for that resource via the URI Converter on my resource set.&nbsp;
Everything seems to be working fine except for the lookup I mention above.&nbsp;
I'm really stumped.</font></font>&nbsp;<font face="Arial"><font size=-1>thanks,</font></font>&nbsp;<font face="Arial"><font size=-1>lp</font></font>
<blockquote dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">"Ed
Merks" &lt;<a href="mailto:merks@ca.ibm.com">merks@ca.ibm.com</a>> wrote
in message <a href="news:3F9FFFB9.2210B7CD@ca.ibm.com">news:3F9FFFB9.2210B7CD@ca.ibm.com</a>...Lance,
<p>Remember that resolveXyz will <b>always</b> return something, but it
may be an unattached placeholder, i.e., getContainer() == null.&nbsp;&nbsp;
The following should be true for what you show below:
<blockquote> sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini tion( "string").getSchema()
== sdt.getSchema().getSchemaForSchema()</blockquote>

<p><br>Lance Phillips wrote:
<blockquote TYPE="CITE">Ed,
<br>&nbsp;&nbsp;&nbsp; Here's the next issue I've run into with the xsd
code.&nbsp; We have a
<br>metamodel for simple data types that we save in a regular xmi resource
not
<br>an xsd resource due to the fact that we've added properties that make
our
<br>model not a valid xsd.&nbsp; When I set a baseType using the following
mechanism
<br> sdt.getSchema().getSchemaForSchema().resolveSimpleTypeDefini tion(( "string"),
<br>I get the correct XSDSimpleTypeDefinition back.&nbsp; However, when
I try to save
<br>the xmi resource, I get a hanging href exception due to the fact that
the
<br>returned type does not exist in a resource.
<p>Any help??</blockquote>
</blockquote>
</blockquote>

</body>
</html>

--------------B5BF9722A45B3BD241B6CF8A--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Next issue...
Next Topic:progress... but still stuck
Goto Forum:
  


Current Time: Mon Sep 21 17:34:00 GMT 2020

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

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

Back to the top