Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Resolving TypeDefinitions from <xsd:include> doesn't match TypeDefintion from element declare
Resolving TypeDefinitions from <xsd:include> doesn't match TypeDefintion from element declare [message #58400] Tue, 01 March 2005 13:45 Go to next message
Steve Speicher is currently offline Steve SpeicherFriend
Messages: 87
Registered: July 2009
Member

This is a multi-part message in MIME format.
--------------090701040406080700040809
Content-Type: multipart/alternative;
boundary="------------030606080606070609060500"


--------------030606080606070609060500
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

I've attached a simple plugin that illustrates the problem.

Basically, I have an included schema that defines 1 complex type. The
including schema has only an element declaration of type from the
included schema. I am unable to locate an appropriate API call to get
matching complex type defintions. This appears to be true for other
types of references too: simple types, element references, etc. My
assumption is that the element declarations type reference would have
returned the same object representing the complex type definition (as it
does when they are defined in the same file)

Note: the DO match if I add 'xmlns:contact="http://www.ibm.com/contact"
targetNamespace="http://www.ibm.com/contact"' to the included schema.
The schema validates as is. I don't have the luxury of changing of my
schemas to have the added schema attributes.

Here's the top-level schema (also included in the ZIP):

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:contact="http://www.ibm.com/contact"
xmlns:cntadv="http://www.ibm.com/contact/advanced"
targetNamespace="http://www.ibm.com/contact"
elementFormDefault="qualified">
<include schemaLocation="Contact_include.xsd"/>
<element name="Contact" type="contact:ContactType"/>
</schema>

Here's the included schema:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<complexType name="ContactType">
<sequence>
<element name="Name" type="string"/>
<element name="Email" type="string"/>
</sequence>
<attribute name="gender" type="string"/>
</complexType>
</schema>

The test program shows that XSDComplexTypeDefinition instance from the
XSDInclude.getResolvedSchema().getContents() does NOT equal (via the
"==" operator) XSDElementDeclaration.getTypeDefinition().

This affects me as I depend on the hashCodes to be the same to ensure I
don't reconstruct more that I need.

Note about the sample code:
- Adds a menu option to context menu for *.xsd called "Parse XSD with
Include"

Thanks in advance,
Steve

--------------030606080606070609060500
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">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
I've attached a simple plugin that illustrates the problem.<br>
<br>
Basically, I have an included schema that defines 1 complex type.&nbsp; The
including schema has only an element declaration of type from the
included schema.&nbsp; I am unable to locate an appropriate API call to get
matching complex type defintions.&nbsp; This appears to be true for other
types of references too: simple types, element references, etc.&nbsp; My
assumption is that the element declarations type reference would have
returned the same object representing the complex type definition (as
it does when they are defined in the same file)<br>
<br>
Note: the DO match if I add <tt>'xmlns:contact=<a class="moz-txt-link-rfc2396E" href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>
</tt><tt>targetNamespace=<a class="moz-txt-link-rfc2396E" href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>'</tt> to the
included schema.&nbsp; The schema validates as is.&nbsp; I don't have the luxury
of changing of my schemas to have the added schema attributes.<br>
<br>
Here's the top-level schema (also included in the ZIP):<br>
<blockquote><tt>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</tt><br>
<tt>&lt;schema xmlns=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
xmlns:contact=<a class="moz-txt-link-rfc2396E" href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>
xmlns:cntadv=<a class="moz-txt-link-rfc2396E" href="http://www.ibm.com/contact/advanced">"http://www.ibm.com/contact/advanced"</a>
targetNamespace=<a class="moz-txt-link-rfc2396E" href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a> </tt><br>
<tt>&nbsp;&nbsp;&nbsp; elementFormDefault="qualified"&gt;</tt><br>
<tt>&nbsp; &lt;include schemaLocation="Contact_include.xsd"/&gt;</tt><br>
<tt>&nbsp; &lt;element name="Contact" type="contact:ContactType"/&gt;</tt><br>
<tt>&lt;/schema&gt;</tt><br>
</blockquote>
Here's the included schema:<br>
<blockquote><tt>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</tt><br>
<tt>&lt;schema xmlns=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
elementFormDefault="qualified"&gt;</tt><br>
<tt>&nbsp; &lt;complexType name="ContactType"&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp; &lt;sequence&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;element name="Name" type="string"/&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;element name="Email" type="string"/&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp; &lt;/sequence&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp; &lt;attribute name="gender" type="string"/&gt;</tt><br>
<tt>&nbsp; &lt;/complexType&gt;</tt><br>
<tt>&lt;/schema&gt;<br>
</tt></blockquote>
The test program shows that XSDComplexTypeDefinition instance from the
XSDInclude.getResolvedSchema().getContents() does NOT equal (via the
"==" operator) XSDElementDeclaration.getTypeDefinition().<br>
<br>
This affects me as I depend on the hashCodes to be the same to ensure I
don't reconstruct more that I need.<br>
<br>
Note about the sample code:<br>
&nbsp; - Adds a menu option to context menu for *.xsd called "Parse XSD with
Include"<br>
<br>
Thanks in advance,<br>
Steve<br>
</body>
</html>

--------------030606080606070609060500--

--------------090701040406080700040809
Content-Type: application/zip;
name="xsd.include.sample.zip"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="xsd.include.sample.zip"

UEsDBBQACAAIAGY/YTLKfBFNpQAAADMBAAArAAAAY29tLmlibS5ldGVjaC54 c2Quc2FtcGxl
LmluY2x1ZG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AQAApgIAABMAAAAAAAAAAAAgAAAAHRsAAENvbnRhY3Rf aW5jbHVkZS54
c2RQSwECGQAUAAAACACNOGEy9DoxYxkBAADoAQAAHAAAAAAAAAAAACAAAADM HAAAQ29udGFj
dF90b3BsZXZlbF9pbmNsdWRlLnhzZFBLBQYAAAAACgAKADUEAABDHgAAAAA=
--------------090701040406080700040809--
Re: Resolving TypeDefinitions from <xsd:include> doesn't match TypeDefintion from element decl [message #58424 is a reply to message #58400] Tue, 01 March 2005 15:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

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

Steve,

The resolved schema is the original schema without a changed namespace.
You need call getIncorporatedSchema to access the cloned version that
has the namespace retargeted.


Steve Speicher wrote:

> I've attached a simple plugin that illustrates the problem.
>
> Basically, I have an included schema that defines 1 complex type. The
> including schema has only an element declaration of type from the
> included schema. I am unable to locate an appropriate API call to get
> matching complex type defintions. This appears to be true for other
> types of references too: simple types, element references, etc. My
> assumption is that the element declarations type reference would have
> returned the same object representing the complex type definition (as
> it does when they are defined in the same file)
>
> Note: the DO match if I add
> 'xmlns:contact="http://www.ibm.com/contact"
> targetNamespace="http://www.ibm.com/contact"' to the included schema.
> The schema validates as is. I don't have the luxury of changing of my
> schemas to have the added schema attributes.
>
> Here's the top-level schema (also included in the ZIP):
>
> <?xml version="1.0" encoding="UTF-8"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
> xmlns:contact="http://www.ibm.com/contact"
> xmlns:cntadv="http://www.ibm.com/contact/advanced"
> targetNamespace="http://www.ibm.com/contact"
> elementFormDefault="qualified">
> <include schemaLocation="Contact_include.xsd"/>
> <element name="Contact" type="contact:ContactType"/>
> </schema>
>
> Here's the included schema:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified">
> <complexType name="ContactType">
> <sequence>
> <element name="Name" type="string"/>
> <element name="Email" type="string"/>
> </sequence>
> <attribute name="gender" type="string"/>
> </complexType>
> </schema>
>
> The test program shows that XSDComplexTypeDefinition instance from the
> XSDInclude.getResolvedSchema().getContents() does NOT equal (via the
> "==" operator) XSDElementDeclaration.getTypeDefinition().
>
> This affects me as I depend on the hashCodes to be the same to ensure
> I don't reconstruct more that I need.
>
> Note about the sample code:
> - Adds a menu option to context menu for *.xsd called "Parse XSD
> with Include"
>
> Thanks in advance,
> Steve



--------------030606070207060308090001
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">
Steve,<br>
<br>
The resolved schema is the original schema without a changed
namespace.&nbsp; You need call getIncorporatedSchema to access the cloned
version that has the namespace retargeted.<br>
<br>
<br>
Steve Speicher wrote:
<blockquote cite="midd01rld$ete$1@www.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
I've attached a simple plugin that illustrates the problem.<br>
<br>
Basically, I have an included schema that defines 1 complex type.&nbsp; The
including schema has only an element declaration of type from the
included schema.&nbsp; I am unable to locate an appropriate API call to get
matching complex type defintions.&nbsp; This appears to be true for other
types of references too: simple types, element references, etc.&nbsp; My
assumption is that the element declarations type reference would have
returned the same object representing the complex type definition (as
it does when they are defined in the same file)<br>
<br>
Note: the DO match if I add <tt>'xmlns:contact=<a
class="moz-txt-link-rfc2396E" href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>
</tt><tt>targetNamespace=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>'</tt>
to the
included schema.&nbsp; The schema validates as is.&nbsp; I don't have the luxury
of changing of my schemas to have the added schema attributes.<br>
<br>
Here's the top-level schema (also included in the ZIP):<br>
<blockquote><tt>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</tt><br>
<tt>&lt;schema xmlns=<a class="moz-txt-link-rfc2396E"
href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
xmlns:contact=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>
xmlns:cntadv=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact/advanced">"http://www.ibm.com/contact/advanced"</a>
targetNamespace=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a> </tt><br>
<tt>&nbsp;&nbsp;&nbsp; elementFormDefault="qualified"&gt;</tt><br>
<tt>&nbsp; &lt;include schemaLocation="Contact_include.xsd"/&gt;</tt><br>
<tt>&nbsp; &lt;element name="Contact" type="contact:ContactType"/&gt;</tt><br>
<tt>&lt;/schema&gt;</tt><br>
</blockquote>
Here's the included schema:<br>
<blockquote><tt>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</tt><br>
<tt>&lt;schema xmlns=<a class="moz-txt-link-rfc2396E"
href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
elementFormDefault="qualified"&gt;</tt><br>
<tt>&nbsp; &lt;complexType name="ContactType"&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp; &lt;sequence&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;element name="Name" type="string"/&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;element name="Email" type="string"/&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp; &lt;/sequence&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp; &lt;attribute name="gender" type="string"/&gt;</tt><br>
<tt>&nbsp; &lt;/complexType&gt;</tt><br>
<tt>&lt;/schema&gt;<br>
</tt></blockquote>
The test program shows that XSDComplexTypeDefinition instance from the
XSDInclude.getResolvedSchema().getContents() does NOT equal (via the
"==" operator) XSDElementDeclaration.getTypeDefinition().<br>
<br>
This affects me as I depend on the hashCodes to be the same to ensure I
don't reconstruct more that I need.<br>
<br>
Note about the sample code:<br>
&nbsp; - Adds a menu option to context menu for *.xsd called "Parse XSD with
Include"<br>
<br>
Thanks in advance,<br>
Steve<br>
</blockquote>
<br>
</body>
</html>

--------------030606070207060308090001--
Re: Resolving TypeDefinitions from <xsd:include> doesn't match TypeDefintion from element decl [message #58442 is a reply to message #58424] Wed, 02 March 2005 13:40 Go to previous messageGo to next message
Steve Speicher is currently offline Steve SpeicherFriend
Messages: 87
Registered: July 2009
Member

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

Ed,

Thanks. That did the trick.

Ed Merks wrote:

> Steve,
>
> The resolved schema is the original schema without a changed
> namespace. You need call getIncorporatedSchema to access the cloned
> version that has the namespace retargeted.
>
>
> Steve Speicher wrote:
>
>> I've attached a simple plugin that illustrates the problem.
>>
>> Basically, I have an included schema that defines 1 complex type.
>> The including schema has only an element declaration of type from the
>> included schema. I am unable to locate an appropriate API call to
>> get matching complex type defintions. This appears to be true for
>> other types of references too: simple types, element references,
>> etc. My assumption is that the element declarations type reference
>> would have returned the same object representing the complex type
>> definition (as it does when they are defined in the same file)
>>
>> Note: the DO match if I add
>> 'xmlns:contact="http://www.ibm.com/contact"
>> targetNamespace="http://www.ibm.com/contact"' to the included
>> schema. The schema validates as is. I don't have the luxury of
>> changing of my schemas to have the added schema attributes.
>>
>> Here's the top-level schema (also included in the ZIP):
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <schema xmlns="http://www.w3.org/2001/XMLSchema"
>> xmlns:contact="http://www.ibm.com/contact"
>> xmlns:cntadv="http://www.ibm.com/contact/advanced"
>> targetNamespace="http://www.ibm.com/contact"
>> elementFormDefault="qualified">
>> <include schemaLocation="Contact_include.xsd"/>
>> <element name="Contact" type="contact:ContactType"/>
>> </schema>
>>
>> Here's the included schema:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <schema xmlns="http://www.w3.org/2001/XMLSchema"
>> elementFormDefault="qualified">
>> <complexType name="ContactType">
>> <sequence>
>> <element name="Name" type="string"/>
>> <element name="Email" type="string"/>
>> </sequence>
>> <attribute name="gender" type="string"/>
>> </complexType>
>> </schema>
>>
>> The test program shows that XSDComplexTypeDefinition instance from
>> the XSDInclude.getResolvedSchema().getContents() does NOT equal (via
>> the "==" operator) XSDElementDeclaration.getTypeDefinition().
>>
>> This affects me as I depend on the hashCodes to be the same to ensure
>> I don't reconstruct more that I need.
>>
>> Note about the sample code:
>> - Adds a menu option to context menu for *.xsd called "Parse XSD
>> with Include"
>>
>> Thanks in advance,
>> Steve
>
>

--------------060307030206010309080709
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">
Ed,<br>
<br>
Thanks.&nbsp; That did the trick.<br>
<br>
Ed Merks wrote:
<blockquote cite="midd022j9$lgb$1@www.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
Steve,<br>
<br>
The resolved schema is the original schema without a changed
namespace.&nbsp; You need call getIncorporatedSchema to access the cloned
version that has the namespace retargeted.<br>
<br>
<br>
Steve Speicher wrote:
<blockquote cite="midd01rld$ete$1@www.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
I've attached a simple plugin that illustrates the problem.<br>
<br>
Basically, I have an included schema that defines 1 complex type.&nbsp; The
including schema has only an element declaration of type from the
included schema.&nbsp; I am unable to locate an appropriate API call to get
matching complex type defintions.&nbsp; This appears to be true for other
types of references too: simple types, element references, etc.&nbsp; My
assumption is that the element declarations type reference would have
returned the same object representing the complex type definition (as
it does when they are defined in the same file)<br>
<br>
Note: the DO match if I add <tt>'xmlns:contact=<a
class="moz-txt-link-rfc2396E" href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>
</tt><tt>targetNamespace=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>'</tt>
to the
included schema.&nbsp; The schema validates as is.&nbsp; I don't have the luxury
of changing of my schemas to have the added schema attributes.<br>
<br>
Here's the top-level schema (also included in the ZIP):<br>
<blockquote><tt>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</tt><br>
<tt>&lt;schema xmlns=<a class="moz-txt-link-rfc2396E"
href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
xmlns:contact=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>
xmlns:cntadv=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact/advanced">"http://www.ibm.com/contact/advanced"</a>
targetNamespace=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a> </tt><br>
<tt>&nbsp;&nbsp;&nbsp; elementFormDefault="qualified"&gt;</tt><br>
<tt>&nbsp; &lt;include schemaLocation="Contact_include.xsd"/&gt;</tt><br>
<tt>&nbsp; &lt;element name="Contact" type="contact:ContactType"/&gt;</tt><br>
<tt>&lt;/schema&gt;</tt><br>
</blockquote>
Here's the included schema:<br>
<blockquote><tt>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</tt><br>
<tt>&lt;schema xmlns=<a class="moz-txt-link-rfc2396E"
href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
elementFormDefault="qualified"&gt;</tt><br>
<tt>&nbsp; &lt;complexType name="ContactType"&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp; &lt;sequence&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;element name="Name" type="string"/&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;element name="Email" type="string"/&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp; &lt;/sequence&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp; &lt;attribute name="gender" type="string"/&gt;</tt><br>
<tt>&nbsp; &lt;/complexType&gt;</tt><br>
<tt>&lt;/schema&gt;<br>
</tt></blockquote>
The test program shows that XSDComplexTypeDefinition instance from the
XSDInclude.getResolvedSchema().getContents() does NOT equal (via the
"==" operator) XSDElementDeclaration.getTypeDefinition().<br>
<br>
This affects me as I depend on the hashCodes to be the same to ensure I
don't reconstruct more that I need.<br>
<br>
Note about the sample code:<br>
&nbsp; - Adds a menu option to context menu for *.xsd called "Parse XSD with
Include"<br>
<br>
Thanks in advance,<br>
Steve<br>
</blockquote>
<br>
</blockquote>
</body>
</html>

--------------060307030206010309080709--
Re: Resolving TypeDefinitions from <xsd:include> doesn't match TypeDefintion from element decl [message #58455 is a reply to message #58400] Mon, 07 March 2005 16:34 Go to previous messageGo to next message
Steve Speicher is currently offline Steve SpeicherFriend
Messages: 87
Registered: July 2009
Member

Hi,

I have a related issue that I can't seem to overcome. Basically I have
a root schema that includes 2 other schemas. One of the included
schemas happens to include the other included schema from the root schema.

Take for example I have root.xsd that looks like:

<schema ...>
<include schemaLocation="include1.xsd"/>
<include schemaLocation="include2.xsd"/>
..
</schema>

Where include1.xsd looks something like:
<schema ...>
<include schemaLocation="include2.xsd"/>
...
</schema>

It appears that the API gives me 2 different instances of XSDInclude for
the 2 different include2.xsd's. Though, the simple type definition I
have in in include2.xsd both have the same instance of
XSDSimpleTypeDefinition.

Is there a reason why I'm getting the 2 different instances of
XSDInclude? I can't seem to locate an API call that would give me just 1.

Thanks in advance for any help.

Steve
Re: Resolving TypeDefinitions from <xsd:include> doesn't match TypeDefintion from element decl [message #58466 is a reply to message #58455] Tue, 08 March 2005 13:23 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Steve,

I'm not sure what the problem is. Clearly your example really does have
two different includes of the same schema so I would expect there to be
two XSDInclude instances that refer to the same XSDSchema instance.
Perhaps you simply need to collect all the unique XSDSchema instances?
Or perhaps you simply want to look at features like
XSDSchema.getTypeDefinitions which collects all the types from all the
schemas?


Steve Speicher wrote:

> Hi,
>
> I have a related issue that I can't seem to overcome. Basically I
> have a root schema that includes 2 other schemas. One of the included
> schemas happens to include the other included schema from the root
> schema.
>
> Take for example I have root.xsd that looks like:
>
> <schema ...>
> <include schemaLocation="include1.xsd"/>
> <include schemaLocation="include2.xsd"/>
> ..
> </schema>
>
> Where include1.xsd looks something like:
> <schema ...>
> <include schemaLocation="include2.xsd"/>
> ...
> </schema>
>
> It appears that the API gives me 2 different instances of XSDInclude
> for the 2 different include2.xsd's. Though, the simple type
> definition I have in in include2.xsd both have the same instance of
> XSDSimpleTypeDefinition.
>
> Is there a reason why I'm getting the 2 different instances of
> XSDInclude? I can't seem to locate an API call that would give me
> just 1.
>
> Thanks in advance for any help.
>
> Steve
Re: Resolving TypeDefinitions from <xsd:include> doesn't match TypeDefintion from element decl [message #594374 is a reply to message #58400] Tue, 01 March 2005 15:43 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33184
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030606070207060308090001
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Steve,

The resolved schema is the original schema without a changed namespace.
You need call getIncorporatedSchema to access the cloned version that
has the namespace retargeted.


Steve Speicher wrote:

> I've attached a simple plugin that illustrates the problem.
>
> Basically, I have an included schema that defines 1 complex type. The
> including schema has only an element declaration of type from the
> included schema. I am unable to locate an appropriate API call to get
> matching complex type defintions. This appears to be true for other
> types of references too: simple types, element references, etc. My
> assumption is that the element declarations type reference would have
> returned the same object representing the complex type definition (as
> it does when they are defined in the same file)
>
> Note: the DO match if I add
> 'xmlns:contact="http://www.ibm.com/contact"
> targetNamespace="http://www.ibm.com/contact"' to the included schema.
> The schema validates as is. I don't have the luxury of changing of my
> schemas to have the added schema attributes.
>
> Here's the top-level schema (also included in the ZIP):
>
> <?xml version="1.0" encoding="UTF-8"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
> xmlns:contact="http://www.ibm.com/contact"
> xmlns:cntadv="http://www.ibm.com/contact/advanced"
> targetNamespace="http://www.ibm.com/contact"
> elementFormDefault="qualified">
> <include schemaLocation="Contact_include.xsd"/>
> <element name="Contact" type="contact:ContactType"/>
> </schema>
>
> Here's the included schema:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified">
> <complexType name="ContactType">
> <sequence>
> <element name="Name" type="string"/>
> <element name="Email" type="string"/>
> </sequence>
> <attribute name="gender" type="string"/>
> </complexType>
> </schema>
>
> The test program shows that XSDComplexTypeDefinition instance from the
> XSDInclude.getResolvedSchema().getContents() does NOT equal (via the
> "==" operator) XSDElementDeclaration.getTypeDefinition().
>
> This affects me as I depend on the hashCodes to be the same to ensure
> I don't reconstruct more that I need.
>
> Note about the sample code:
> - Adds a menu option to context menu for *.xsd called "Parse XSD
> with Include"
>
> Thanks in advance,
> Steve



--------------030606070207060308090001
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">
Steve,<br>
<br>
The resolved schema is the original schema without a changed
namespace.&nbsp; You need call getIncorporatedSchema to access the cloned
version that has the namespace retargeted.<br>
<br>
<br>
Steve Speicher wrote:
<blockquote cite="midd01rld$ete$1@www.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
I've attached a simple plugin that illustrates the problem.<br>
<br>
Basically, I have an included schema that defines 1 complex type.&nbsp; The
including schema has only an element declaration of type from the
included schema.&nbsp; I am unable to locate an appropriate API call to get
matching complex type defintions.&nbsp; This appears to be true for other
types of references too: simple types, element references, etc.&nbsp; My
assumption is that the element declarations type reference would have
returned the same object representing the complex type definition (as
it does when they are defined in the same file)<br>
<br>
Note: the DO match if I add <tt>'xmlns:contact=<a
class="moz-txt-link-rfc2396E" href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>
</tt><tt>targetNamespace=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>'</tt>
to the
included schema.&nbsp; The schema validates as is.&nbsp; I don't have the luxury
of changing of my schemas to have the added schema attributes.<br>
<br>
Here's the top-level schema (also included in the ZIP):<br>
<blockquote><tt>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</tt><br>
<tt>&lt;schema xmlns=<a class="moz-txt-link-rfc2396E"
href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
xmlns:contact=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>
xmlns:cntadv=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact/advanced">"http://www.ibm.com/contact/advanced"</a>
targetNamespace=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a> </tt><br>
<tt>&nbsp;&nbsp;&nbsp; elementFormDefault="qualified"&gt;</tt><br>
<tt>&nbsp; &lt;include schemaLocation="Contact_include.xsd"/&gt;</tt><br>
<tt>&nbsp; &lt;element name="Contact" type="contact:ContactType"/&gt;</tt><br>
<tt>&lt;/schema&gt;</tt><br>
</blockquote>
Here's the included schema:<br>
<blockquote><tt>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</tt><br>
<tt>&lt;schema xmlns=<a class="moz-txt-link-rfc2396E"
href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
elementFormDefault="qualified"&gt;</tt><br>
<tt>&nbsp; &lt;complexType name="ContactType"&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp; &lt;sequence&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;element name="Name" type="string"/&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;element name="Email" type="string"/&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp; &lt;/sequence&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp; &lt;attribute name="gender" type="string"/&gt;</tt><br>
<tt>&nbsp; &lt;/complexType&gt;</tt><br>
<tt>&lt;/schema&gt;<br>
</tt></blockquote>
The test program shows that XSDComplexTypeDefinition instance from the
XSDInclude.getResolvedSchema().getContents() does NOT equal (via the
"==" operator) XSDElementDeclaration.getTypeDefinition().<br>
<br>
This affects me as I depend on the hashCodes to be the same to ensure I
don't reconstruct more that I need.<br>
<br>
Note about the sample code:<br>
&nbsp; - Adds a menu option to context menu for *.xsd called "Parse XSD with
Include"<br>
<br>
Thanks in advance,<br>
Steve<br>
</blockquote>
<br>
</body>
</html>

--------------030606070207060308090001--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Resolving TypeDefinitions from <xsd:include> doesn't match TypeDefintion from element decl [message #594386 is a reply to message #58424] Wed, 02 March 2005 13:40 Go to previous message
Steve Speicher is currently offline Steve SpeicherFriend
Messages: 87
Registered: July 2009
Member

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

Ed,

Thanks. That did the trick.

Ed Merks wrote:

> Steve,
>
> The resolved schema is the original schema without a changed
> namespace. You need call getIncorporatedSchema to access the cloned
> version that has the namespace retargeted.
>
>
> Steve Speicher wrote:
>
>> I've attached a simple plugin that illustrates the problem.
>>
>> Basically, I have an included schema that defines 1 complex type.
>> The including schema has only an element declaration of type from the
>> included schema. I am unable to locate an appropriate API call to
>> get matching complex type defintions. This appears to be true for
>> other types of references too: simple types, element references,
>> etc. My assumption is that the element declarations type reference
>> would have returned the same object representing the complex type
>> definition (as it does when they are defined in the same file)
>>
>> Note: the DO match if I add
>> 'xmlns:contact="http://www.ibm.com/contact"
>> targetNamespace="http://www.ibm.com/contact"' to the included
>> schema. The schema validates as is. I don't have the luxury of
>> changing of my schemas to have the added schema attributes.
>>
>> Here's the top-level schema (also included in the ZIP):
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <schema xmlns="http://www.w3.org/2001/XMLSchema"
>> xmlns:contact="http://www.ibm.com/contact"
>> xmlns:cntadv="http://www.ibm.com/contact/advanced"
>> targetNamespace="http://www.ibm.com/contact"
>> elementFormDefault="qualified">
>> <include schemaLocation="Contact_include.xsd"/>
>> <element name="Contact" type="contact:ContactType"/>
>> </schema>
>>
>> Here's the included schema:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <schema xmlns="http://www.w3.org/2001/XMLSchema"
>> elementFormDefault="qualified">
>> <complexType name="ContactType">
>> <sequence>
>> <element name="Name" type="string"/>
>> <element name="Email" type="string"/>
>> </sequence>
>> <attribute name="gender" type="string"/>
>> </complexType>
>> </schema>
>>
>> The test program shows that XSDComplexTypeDefinition instance from
>> the XSDInclude.getResolvedSchema().getContents() does NOT equal (via
>> the "==" operator) XSDElementDeclaration.getTypeDefinition().
>>
>> This affects me as I depend on the hashCodes to be the same to ensure
>> I don't reconstruct more that I need.
>>
>> Note about the sample code:
>> - Adds a menu option to context menu for *.xsd called "Parse XSD
>> with Include"
>>
>> Thanks in advance,
>> Steve
>
>

--------------060307030206010309080709
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">
Ed,<br>
<br>
Thanks.&nbsp; That did the trick.<br>
<br>
Ed Merks wrote:
<blockquote cite="midd022j9$lgb$1@www.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
Steve,<br>
<br>
The resolved schema is the original schema without a changed
namespace.&nbsp; You need call getIncorporatedSchema to access the cloned
version that has the namespace retargeted.<br>
<br>
<br>
Steve Speicher wrote:
<blockquote cite="midd01rld$ete$1@www.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
I've attached a simple plugin that illustrates the problem.<br>
<br>
Basically, I have an included schema that defines 1 complex type.&nbsp; The
including schema has only an element declaration of type from the
included schema.&nbsp; I am unable to locate an appropriate API call to get
matching complex type defintions.&nbsp; This appears to be true for other
types of references too: simple types, element references, etc.&nbsp; My
assumption is that the element declarations type reference would have
returned the same object representing the complex type definition (as
it does when they are defined in the same file)<br>
<br>
Note: the DO match if I add <tt>'xmlns:contact=<a
class="moz-txt-link-rfc2396E" href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>
</tt><tt>targetNamespace=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>'</tt>
to the
included schema.&nbsp; The schema validates as is.&nbsp; I don't have the luxury
of changing of my schemas to have the added schema attributes.<br>
<br>
Here's the top-level schema (also included in the ZIP):<br>
<blockquote><tt>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</tt><br>
<tt>&lt;schema xmlns=<a class="moz-txt-link-rfc2396E"
href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
xmlns:contact=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>
xmlns:cntadv=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact/advanced">"http://www.ibm.com/contact/advanced"</a>
targetNamespace=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a> </tt><br>
<tt>&nbsp;&nbsp;&nbsp; elementFormDefault="qualified"&gt;</tt><br>
<tt>&nbsp; &lt;include schemaLocation="Contact_include.xsd"/&gt;</tt><br>
<tt>&nbsp; &lt;element name="Contact" type="contact:ContactType"/&gt;</tt><br>
<tt>&lt;/schema&gt;</tt><br>
</blockquote>
Here's the included schema:<br>
<blockquote><tt>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</tt><br>
<tt>&lt;schema xmlns=<a class="moz-txt-link-rfc2396E"
href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
elementFormDefault="qualified"&gt;</tt><br>
<tt>&nbsp; &lt;complexType name="ContactType"&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp; &lt;sequence&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;element name="Name" type="string"/&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;element name="Email" type="string"/&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp; &lt;/sequence&gt;</tt><br>
<tt>&nbsp;&nbsp;&nbsp; &lt;attribute name="gender" type="string"/&gt;</tt><br>
<tt>&nbsp; &lt;/complexType&gt;</tt><br>
<tt>&lt;/schema&gt;<br>
</tt></blockquote>
The test program shows that XSDComplexTypeDefinition instance from the
XSDInclude.getResolvedSchema().getContents() does NOT equal (via the
"==" operator) XSDElementDeclaration.getTypeDefinition().<br>
<br>
This affects me as I depend on the hashCodes to be the same to ensure I
don't reconstruct more that I need.<br>
<br>
Note about the sample code:<br>
&nbsp; - Adds a menu option to context menu for *.xsd called "Parse XSD with
Include"<br>
<br>
Thanks in advance,<br>
Steve<br>
</blockquote>
<br>
</blockquote>
</body>
</html>

--------------060307030206010309080709--
Re: Resolving TypeDefinitions from <xsd:include> doesn't match TypeDefintion from element decl [message #594396 is a reply to message #58400] Mon, 07 March 2005 16:34 Go to previous message
Steve Speicher is currently offline Steve SpeicherFriend
Messages: 87
Registered: July 2009
Member

Hi,

I have a related issue that I can't seem to overcome. Basically I have
a root schema that includes 2 other schemas. One of the included
schemas happens to include the other included schema from the root schema.

Take for example I have root.xsd that looks like:

<schema ...>
<include schemaLocation="include1.xsd"/>
<include schemaLocation="include2.xsd"/>
..
</schema>

Where include1.xsd looks something like:
<schema ...>
<include schemaLocation="include2.xsd"/>
...
</schema>

It appears that the API gives me 2 different instances of XSDInclude for
the 2 different include2.xsd's. Though, the simple type definition I
have in in include2.xsd both have the same instance of
XSDSimpleTypeDefinition.

Is there a reason why I'm getting the 2 different instances of
XSDInclude? I can't seem to locate an API call that would give me just 1.

Thanks in advance for any help.

Steve
Re: Resolving TypeDefinitions from <xsd:include> doesn't match TypeDefintion from element decl [message #594410 is a reply to message #58455] Tue, 08 March 2005 13:23 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33184
Registered: July 2009
Senior Member
Steve,

I'm not sure what the problem is. Clearly your example really does have
two different includes of the same schema so I would expect there to be
two XSDInclude instances that refer to the same XSDSchema instance.
Perhaps you simply need to collect all the unique XSDSchema instances?
Or perhaps you simply want to look at features like
XSDSchema.getTypeDefinitions which collects all the types from all the
schemas?


Steve Speicher wrote:

> Hi,
>
> I have a related issue that I can't seem to overcome. Basically I
> have a root schema that includes 2 other schemas. One of the included
> schemas happens to include the other included schema from the root
> schema.
>
> Take for example I have root.xsd that looks like:
>
> <schema ...>
> <include schemaLocation="include1.xsd"/>
> <include schemaLocation="include2.xsd"/>
> ..
> </schema>
>
> Where include1.xsd looks something like:
> <schema ...>
> <include schemaLocation="include2.xsd"/>
> ...
> </schema>
>
> It appears that the API gives me 2 different instances of XSDInclude
> for the 2 different include2.xsd's. Though, the simple type
> definition I have in in include2.xsd both have the same instance of
> XSDSimpleTypeDefinition.
>
> Is there a reason why I'm getting the 2 different instances of
> XSDInclude? I can't seem to locate an API call that would give me
> just 1.
>
> Thanks in advance for any help.
>
> Steve


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Resolving TypeDefinitions from <xsd:include> doesn't match TypeDefintion from element declare
Next Topic:Multiple inheritance in EMF -> XSD
Goto Forum:
  


Current Time: Fri Jul 19 05:22:33 GMT 2024

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

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

Back to the top