Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Loading chameleon schemas
Loading chameleon schemas [message #74773] Mon, 23 June 2008 20:42 Go to next message
Dave Carlson is currently offline Dave CarlsonFriend
Messages: 402
Registered: July 2009
Senior Member
Some schemas use the pattern of importing (or including) a schema that has
no targetNamespace into a schema that does have a namespace (aka chameleon
schemas). When using the XSD model to load these schemas, the imported
chameleon schema definitions are added to EACH schema that imports them. I
believe that this is correct from the perspective of the XSD infoset, but it
causes problems when I want to access and process the XSD definitions as
defined in each original schema. My use case is to transform the XSD to a
UML model that reflects the original schema modularity.

Is there any way to change this behavior when loading XSD so that a
chameleon schema is loaded only once with a null targetNamespace and
imported by the other XSDSchema components? Or, lacking that, some way to
load the chameleon schema and sort out which definitions in other schemas
are actually duplicate copies?

Thanks,
Dave Carlson
Re: Loading chameleon schemas [message #74793 is a reply to message #74773] Mon, 23 June 2008 21:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Dave,

Comments below.

Dave Carlson wrote:
> Some schemas use the pattern of importing (or including) a schema that has
> no targetNamespace into a schema that does have a namespace (aka chameleon
> schemas).
Only including has this effect.
> When using the XSD model to load these schemas, the imported
> chameleon schema definitions are added to EACH schema that imports them. I
> believe that this is correct from the perspective of the XSD infoset, but it
> causes problems when I want to access and process the XSD definitions as
> defined in each original schema. My use case is to transform the XSD to a
> UML model that reflects the original schema modularity.
>
Don't count on that. Decomposition in to .xsd files is completely
arbitrary from an abstract component point of view and the translation
is done at that level, not the syntactic level.
> Is there any way to change this behavior when loading XSD so that a
> chameleon schema is loaded only once with a null targetNamespace and
> imported by the other XSDSchema components? Or, lacking that, some way to
> load the chameleon schema and sort out which definitions in other schemas
> are actually duplicate copies?
>
Not really, no. It's a complex problem to untangle the impact of
chameleon includes. They suck.
> Thanks,
> Dave Carlson
>
>
>
Re: Loading chameleon schemas [message #74810 is a reply to message #74793] Tue, 24 June 2008 16:14 Go to previous messageGo to next message
Dave Carlson is currently offline Dave CarlsonFriend
Messages: 402
Registered: July 2009
Senior Member
Ed,

>> Some schemas use the pattern of importing (or including) a schema that
>> has no targetNamespace into a schema that does have a namespace (aka
>> chameleon schemas).
> Only including has this effect.

I had also thought that xsd:include must be used for chameleon schemas. But
someone recently told me that the Oxygen XML editor throws an error for
this, with a message that xsd:import should be used for chameleons. I
checked the XSD specs (both 1.0 and 1.1) and it appears that either
xsd:include or xsd:import may be used for this. The 'namespace' attribute
is omitted when using xsd:import of a schema with no namespace.

>> imported by the other XSDSchema components? Or, lacking that, some way
>> to load the chameleon schema and sort out which definitions in other
>> schemas are actually duplicate copies?
>>
> Not really, no. It's a complex problem to untangle the impact of
> chameleon includes. They suck.

I couldn't agree more. I try to discourage designers from using chameleon
schemas, but some still like the idea.
Re: Loading chameleon schemas [message #74827 is a reply to message #74810] Tue, 24 June 2008 18:58 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

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

Dave,

Comments below.

Dave Carlson wrote:
> Ed,
>
>
>>> Some schemas use the pattern of importing (or including) a schema that
>>> has no targetNamespace into a schema that does have a namespace (aka
>>> chameleon schemas).
>>>
>> Only including has this effect.
>>
>
> I had also thought that xsd:include must be used for chameleon schemas. But
> someone recently told me that the Oxygen XML editor throws an error for
> this, with a message that xsd:import should be used for chameleons. I
> checked the XSD specs (both 1.0 and 1.1) and it appears that either
> xsd:include or xsd:import may be used for this. The 'namespace' attribute
> is omitted when using xsd:import of a schema with no namespace.
>
An import is just an import. The original components will be imported
with the null namespace. Only an include will do the chameleon thing.
Are you going to believe Oxygen or me? :-P
>
>>> imported by the other XSDSchema components? Or, lacking that, some way
>>> to load the chameleon schema and sort out which definitions in other
>>> schemas are actually duplicate copies?
>>>
>>>
>> Not really, no. It's a complex problem to untangle the impact of
>> chameleon includes. They suck.
>>
>
> I couldn't agree more. I try to discourage designers from using chameleon
> schemas, but some still like the idea.
>
Tell them I consider it a foolish choice. Discourage the use of
redefine even more. That's so horrible I cringe at the mention of it.
>
>


--------------020300020006070009090201
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Dave,<br>
<br>
Comments below.<br>
<br>
Dave Carlson wrote:
<blockquote cite="mid:g3r6hs$vto$1@build.eclipse.org" type="cite">
<pre wrap="">Ed,

</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">Some schemas use the pattern of importing (or including) a schema that
has no targetNamespace into a schema that does have a namespace (aka
chameleon schemas).
</pre>
</blockquote>
<pre wrap="">Only including has this effect.
</pre>
</blockquote>
<pre wrap=""><!---->
I had also thought that xsd:include must be used for chameleon schemas. But
someone recently told me that the Oxygen XML editor throws an error for
this, with a message that xsd:import should be used for chameleons. I
checked the XSD specs (both 1.0 and 1.1) and it appears that either
xsd:include or xsd:import may be used for this. The 'namespace' attribute
is omitted when using xsd:import of a schema with no namespace.
</pre>
</blockquote>
An import is just an import.&nbsp; The original components will be imported
with the null namespace.&nbsp; Only an include will do the chameleon thing.&nbsp;
Are you going to believe Oxygen or me? :-P<br>
<blockquote cite="mid:g3r6hs$vto$1@build.eclipse.org" type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">imported by the other XSDSchema components? Or, lacking that, some way
to load the chameleon schema and sort out which definitions in other
schemas are actually duplicate copies?

</pre>
</blockquote>
<pre wrap="">Not really, no. It's a complex problem to untangle the impact of
chameleon includes. They suck.
</pre>
</blockquote>
<pre wrap=""><!---->
I couldn't agree more. I try to discourage designers from using chameleon
schemas, but some still like the idea.
</pre>
</blockquote>
Tell them I consider it a foolish choice.&nbsp; Discourage the use of
redefine even more.&nbsp; That's so horrible I cringe at the mention of it.<br>
<blockquote cite="mid:g3r6hs$vto$1@build.eclipse.org" type="cite">
<pre wrap="">

</pre>
</blockquote>
<br>
</body>
</html>

--------------020300020006070009090201--
Re: Loading chameleon schemas [message #603110 is a reply to message #74773] Mon, 23 June 2008 21:30 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Dave,

Comments below.

Dave Carlson wrote:
> Some schemas use the pattern of importing (or including) a schema that has
> no targetNamespace into a schema that does have a namespace (aka chameleon
> schemas).
Only including has this effect.
> When using the XSD model to load these schemas, the imported
> chameleon schema definitions are added to EACH schema that imports them. I
> believe that this is correct from the perspective of the XSD infoset, but it
> causes problems when I want to access and process the XSD definitions as
> defined in each original schema. My use case is to transform the XSD to a
> UML model that reflects the original schema modularity.
>
Don't count on that. Decomposition in to .xsd files is completely
arbitrary from an abstract component point of view and the translation
is done at that level, not the syntactic level.
> Is there any way to change this behavior when loading XSD so that a
> chameleon schema is loaded only once with a null targetNamespace and
> imported by the other XSDSchema components? Or, lacking that, some way to
> load the chameleon schema and sort out which definitions in other schemas
> are actually duplicate copies?
>
Not really, no. It's a complex problem to untangle the impact of
chameleon includes. They suck.
> Thanks,
> Dave Carlson
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Loading chameleon schemas [message #603115 is a reply to message #74793] Tue, 24 June 2008 16:14 Go to previous message
Dave Carlson is currently offline Dave CarlsonFriend
Messages: 402
Registered: July 2009
Senior Member
Ed,

>> Some schemas use the pattern of importing (or including) a schema that
>> has no targetNamespace into a schema that does have a namespace (aka
>> chameleon schemas).
> Only including has this effect.

I had also thought that xsd:include must be used for chameleon schemas. But
someone recently told me that the Oxygen XML editor throws an error for
this, with a message that xsd:import should be used for chameleons. I
checked the XSD specs (both 1.0 and 1.1) and it appears that either
xsd:include or xsd:import may be used for this. The 'namespace' attribute
is omitted when using xsd:import of a schema with no namespace.

>> imported by the other XSDSchema components? Or, lacking that, some way
>> to load the chameleon schema and sort out which definitions in other
>> schemas are actually duplicate copies?
>>
> Not really, no. It's a complex problem to untangle the impact of
> chameleon includes. They suck.

I couldn't agree more. I try to discourage designers from using chameleon
schemas, but some still like the idea.
Re: Loading chameleon schemas [message #603119 is a reply to message #74810] Tue, 24 June 2008 18:58 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020300020006070009090201
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Dave,

Comments below.

Dave Carlson wrote:
> Ed,
>
>
>>> Some schemas use the pattern of importing (or including) a schema that
>>> has no targetNamespace into a schema that does have a namespace (aka
>>> chameleon schemas).
>>>
>> Only including has this effect.
>>
>
> I had also thought that xsd:include must be used for chameleon schemas. But
> someone recently told me that the Oxygen XML editor throws an error for
> this, with a message that xsd:import should be used for chameleons. I
> checked the XSD specs (both 1.0 and 1.1) and it appears that either
> xsd:include or xsd:import may be used for this. The 'namespace' attribute
> is omitted when using xsd:import of a schema with no namespace.
>
An import is just an import. The original components will be imported
with the null namespace. Only an include will do the chameleon thing.
Are you going to believe Oxygen or me? :-P
>
>>> imported by the other XSDSchema components? Or, lacking that, some way
>>> to load the chameleon schema and sort out which definitions in other
>>> schemas are actually duplicate copies?
>>>
>>>
>> Not really, no. It's a complex problem to untangle the impact of
>> chameleon includes. They suck.
>>
>
> I couldn't agree more. I try to discourage designers from using chameleon
> schemas, but some still like the idea.
>
Tell them I consider it a foolish choice. Discourage the use of
redefine even more. That's so horrible I cringe at the mention of it.
>
>


--------------020300020006070009090201
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Dave,<br>
<br>
Comments below.<br>
<br>
Dave Carlson wrote:
<blockquote cite="mid:g3r6hs$vto$1@build.eclipse.org" type="cite">
<pre wrap="">Ed,

</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">Some schemas use the pattern of importing (or including) a schema that
has no targetNamespace into a schema that does have a namespace (aka
chameleon schemas).
</pre>
</blockquote>
<pre wrap="">Only including has this effect.
</pre>
</blockquote>
<pre wrap=""><!---->
I had also thought that xsd:include must be used for chameleon schemas. But
someone recently told me that the Oxygen XML editor throws an error for
this, with a message that xsd:import should be used for chameleons. I
checked the XSD specs (both 1.0 and 1.1) and it appears that either
xsd:include or xsd:import may be used for this. The 'namespace' attribute
is omitted when using xsd:import of a schema with no namespace.
</pre>
</blockquote>
An import is just an import.&nbsp; The original components will be imported
with the null namespace.&nbsp; Only an include will do the chameleon thing.&nbsp;
Are you going to believe Oxygen or me? :-P<br>
<blockquote cite="mid:g3r6hs$vto$1@build.eclipse.org" type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">imported by the other XSDSchema components? Or, lacking that, some way
to load the chameleon schema and sort out which definitions in other
schemas are actually duplicate copies?

</pre>
</blockquote>
<pre wrap="">Not really, no. It's a complex problem to untangle the impact of
chameleon includes. They suck.
</pre>
</blockquote>
<pre wrap=""><!---->
I couldn't agree more. I try to discourage designers from using chameleon
schemas, but some still like the idea.
</pre>
</blockquote>
Tell them I consider it a foolish choice.&nbsp; Discourage the use of
redefine even more.&nbsp; That's so horrible I cringe at the mention of it.<br>
<blockquote cite="mid:g3r6hs$vto$1@build.eclipse.org" type="cite">
<pre wrap="">

</pre>
</blockquote>
<br>
</body>
</html>

--------------020300020006070009090201--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Loading chameleon schemas
Next Topic:Validation Error "use" parmeter
Goto Forum:
  


Current Time: Sat Apr 20 02:46:40 GMT 2024

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

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

Back to the top