Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Inheritance Problem
Inheritance Problem [message #67893] Tue, 25 April 2006 02:09 Go to next message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 486
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

Hi!

I'm trying to define a simple inheritance model from a web tutorial. I
failed using the XSD sample editor (2.2 RC1), i.e. it didn't let me
define the base type for the extension (it was set to anyType).

Thus, I took the snippet and copied it into a sample schema. But I think
there is something wrong because I get an error annotation that the base
element could not be found.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:this="http:///test/myschema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http:///test/myschema">

<xsd:complexType name="Address">
<!-- stuff -->
</xsd:complexType>

<xsd:complexType name="USAddress">
<xsd:complexContent>
<xsd:extension base="Address">
<!-- stuff -->
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>

As this is my first step in this stuff I probably doing something wrong
here. Any ideas what?

Cu, Gunnar

--
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/
Re: Inheritance Problem [message #67915 is a reply to message #67893] Tue, 25 April 2006 11:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Gunnar,

You have no xmlns declaration that binds the null prefix to the target
namespace of this schema, so the base="Address" reference won't resolve
to the "Address" complex type in this schema. Using base="this:Address"
will work better. The XSD Sample editor is quite a crummy editor so if
you will do any significant amount of editing, the WTP XML Schema editor
is much better.


Gunnar Wagenknecht wrote:
> Hi!
>
> I'm trying to define a simple inheritance model from a web tutorial. I
> failed using the XSD sample editor (2.2 RC1), i.e. it didn't let me
> define the base type for the extension (it was set to anyType).
>
> Thus, I took the snippet and copied it into a sample schema. But I think
> there is something wrong because I get an error annotation that the base
> element could not be found.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema xmlns:this="http:///test/myschema"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http:///test/myschema">
>
> <xsd:complexType name="Address">
> <!-- stuff -->
> </xsd:complexType>
>
> <xsd:complexType name="USAddress">
> <xsd:complexContent>
> <xsd:extension base="Address">
> <!-- stuff -->
> </xsd:extension>
> </xsd:complexContent>
> </xsd:complexType>
> </xsd:schema>
>
> As this is my first step in this stuff I probably doing something wrong
> here. Any ideas what?
>
> Cu, Gunnar
>
>
Re: Inheritance Problem [message #67936 is a reply to message #67915] Tue, 25 April 2006 12:09 Go to previous messageGo to next message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 486
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

Hi Ed,

Ed Merks wrote:
> You have no xmlns declaration that binds the null prefix to the target
> namespace of this schema, so the base="Address" reference won't resolve
> to the "Address" complex type in this schema. Using base="this:Address"
> will work better.

Damn, it's the second time I stumble across an incorrect sample snippet.
:( But all tutorials I read don't mention anything about the null
prefix. How do I set it? xmlns:null?

BTW, I created the schema using the EMF wizard. Maybe the wizard should
add the null prefix by default?

> The XSD Sample editor is quite a crummy editor so if
> you will do any significant amount of editing, the WTP XML Schema editor
> is much better.

Have you used the WTP editor? I wasn't able to create this there. Again,
the base type was fixed to "anyType" and I couldn't change it in the UI.

Cu, Gunnar

--
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/
Re: Inheritance Problem [message #67957 is a reply to message #67936] Tue, 25 April 2006 12:48 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

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

Gunnar,

You can use xmlns="...." to bind the null prefix to a namespace.

I don't install WTP for my development work so I don't have direct
personal experience. If the problem is as you describe, you should open
a bugzilla (but I find it hard to believe that there's no way to set the
base type of a complex type).


Gunnar Wagenknecht wrote:
> Hi Ed,
>
> Ed Merks wrote:
>
>> You have no xmlns declaration that binds the null prefix to the target
>> namespace of this schema, so the base="Address" reference won't resolve
>> to the "Address" complex type in this schema. Using base="this:Address"
>> will work better.
>>
>
> Damn, it's the second time I stumble across an incorrect sample snippet.
> :( But all tutorials I read don't mention anything about the null
> prefix. How do I set it? xmlns:null?
>
> BTW, I created the schema using the EMF wizard. Maybe the wizard should
> add the null prefix by default?
>
>
>> The XSD Sample editor is quite a crummy editor so if
>> you will do any significant amount of editing, the WTP XML Schema editor
>> is much better.
>>
>
> Have you used the WTP editor? I wasn't able to create this there. Again,
> the base type was fixed to "anyType" and I couldn't change it in the UI.
>
> Cu, Gunnar
>
>


--------------030706070209040200060502
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">
Gunnar,<br>
<br>
You can use xmlns="...." to bind the null prefix to a namespace.<br>
<br>
I don't install WTP for my development work so I don't have direct
personal experience.&nbsp; If the problem is as you describe, you should
open a bugzilla (but I find it hard to believe that there's no way to
set the base type of a complex type).<br>
<br>
<br>
Gunnar Wagenknecht wrote:
<blockquote cite="mide2l3hn$qus$1@utils.eclipse.org" type="cite">
<pre wrap="">Hi Ed,

Ed Merks wrote:
</pre>
<blockquote type="cite">
<pre wrap="">You have no xmlns declaration that binds the null prefix to the target
namespace of this schema, so the base="Address" reference won't resolve
to the "Address" complex type in this schema. Using base="this:Address"
will work better.
</pre>
</blockquote>
<pre wrap=""><!---->
Damn, it's the second time I stumble across an incorrect sample snippet.
:( But all tutorials I read don't mention anything about the null
prefix. How do I set it? xmlns:null?

BTW, I created the schema using the EMF wizard. Maybe the wizard should
add the null prefix by default?

</pre>
<blockquote type="cite">
<pre wrap="">The XSD Sample editor is quite a crummy editor so if
you will do any significant amount of editing, the WTP XML Schema editor
is much better.
</pre>
</blockquote>
<pre wrap=""><!---->
Have you used the WTP editor? I wasn't able to create this there. Again,
the base type was fixed to "anyType" and I couldn't change it in the UI.

Cu, Gunnar

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

--------------030706070209040200060502--
Re: Inheritance Problem [message #598021 is a reply to message #67893] Tue, 25 April 2006 11:51 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Gunnar,

You have no xmlns declaration that binds the null prefix to the target
namespace of this schema, so the base="Address" reference won't resolve
to the "Address" complex type in this schema. Using base="this:Address"
will work better. The XSD Sample editor is quite a crummy editor so if
you will do any significant amount of editing, the WTP XML Schema editor
is much better.


Gunnar Wagenknecht wrote:
> Hi!
>
> I'm trying to define a simple inheritance model from a web tutorial. I
> failed using the XSD sample editor (2.2 RC1), i.e. it didn't let me
> define the base type for the extension (it was set to anyType).
>
> Thus, I took the snippet and copied it into a sample schema. But I think
> there is something wrong because I get an error annotation that the base
> element could not be found.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema xmlns:this="http:///test/myschema"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http:///test/myschema">
>
> <xsd:complexType name="Address">
> <!-- stuff -->
> </xsd:complexType>
>
> <xsd:complexType name="USAddress">
> <xsd:complexContent>
> <xsd:extension base="Address">
> <!-- stuff -->
> </xsd:extension>
> </xsd:complexContent>
> </xsd:complexType>
> </xsd:schema>
>
> As this is my first step in this stuff I probably doing something wrong
> here. Any ideas what?
>
> Cu, Gunnar
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Inheritance Problem [message #598025 is a reply to message #67915] Tue, 25 April 2006 12:09 Go to previous message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 486
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

Hi Ed,

Ed Merks wrote:
> You have no xmlns declaration that binds the null prefix to the target
> namespace of this schema, so the base="Address" reference won't resolve
> to the "Address" complex type in this schema. Using base="this:Address"
> will work better.

Damn, it's the second time I stumble across an incorrect sample snippet.
:( But all tutorials I read don't mention anything about the null
prefix. How do I set it? xmlns:null?

BTW, I created the schema using the EMF wizard. Maybe the wizard should
add the null prefix by default?

> The XSD Sample editor is quite a crummy editor so if
> you will do any significant amount of editing, the WTP XML Schema editor
> is much better.

Have you used the WTP editor? I wasn't able to create this there. Again,
the base type was fixed to "anyType" and I couldn't change it in the UI.

Cu, Gunnar

--
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/
Re: Inheritance Problem [message #598033 is a reply to message #67936] Tue, 25 April 2006 12:48 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030706070209040200060502
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Gunnar,

You can use xmlns="...." to bind the null prefix to a namespace.

I don't install WTP for my development work so I don't have direct
personal experience. If the problem is as you describe, you should open
a bugzilla (but I find it hard to believe that there's no way to set the
base type of a complex type).


Gunnar Wagenknecht wrote:
> Hi Ed,
>
> Ed Merks wrote:
>
>> You have no xmlns declaration that binds the null prefix to the target
>> namespace of this schema, so the base="Address" reference won't resolve
>> to the "Address" complex type in this schema. Using base="this:Address"
>> will work better.
>>
>
> Damn, it's the second time I stumble across an incorrect sample snippet.
> :( But all tutorials I read don't mention anything about the null
> prefix. How do I set it? xmlns:null?
>
> BTW, I created the schema using the EMF wizard. Maybe the wizard should
> add the null prefix by default?
>
>
>> The XSD Sample editor is quite a crummy editor so if
>> you will do any significant amount of editing, the WTP XML Schema editor
>> is much better.
>>
>
> Have you used the WTP editor? I wasn't able to create this there. Again,
> the base type was fixed to "anyType" and I couldn't change it in the UI.
>
> Cu, Gunnar
>
>


--------------030706070209040200060502
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">
Gunnar,<br>
<br>
You can use xmlns="...." to bind the null prefix to a namespace.<br>
<br>
I don't install WTP for my development work so I don't have direct
personal experience.&nbsp; If the problem is as you describe, you should
open a bugzilla (but I find it hard to believe that there's no way to
set the base type of a complex type).<br>
<br>
<br>
Gunnar Wagenknecht wrote:
<blockquote cite="mide2l3hn$qus$1@utils.eclipse.org" type="cite">
<pre wrap="">Hi Ed,

Ed Merks wrote:
</pre>
<blockquote type="cite">
<pre wrap="">You have no xmlns declaration that binds the null prefix to the target
namespace of this schema, so the base="Address" reference won't resolve
to the "Address" complex type in this schema. Using base="this:Address"
will work better.
</pre>
</blockquote>
<pre wrap=""><!---->
Damn, it's the second time I stumble across an incorrect sample snippet.
:( But all tutorials I read don't mention anything about the null
prefix. How do I set it? xmlns:null?

BTW, I created the schema using the EMF wizard. Maybe the wizard should
add the null prefix by default?

</pre>
<blockquote type="cite">
<pre wrap="">The XSD Sample editor is quite a crummy editor so if
you will do any significant amount of editing, the WTP XML Schema editor
is much better.
</pre>
</blockquote>
<pre wrap=""><!---->
Have you used the WTP editor? I wasn't able to create this there. Again,
the base type was fixed to "anyType" and I couldn't change it in the UI.

Cu, Gunnar

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

--------------030706070209040200060502--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Inheritance Problem
Next Topic:XSDImporter.java cannot run headless
Goto Forum:
  


Current Time: Wed Apr 24 22:20:15 GMT 2024

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

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

Back to the top