W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2008

RE: One element isn't referenceable, the other is!

From: Xia Li <xli@galdosinc.com>
Date: Thu, 29 May 2008 11:33:23 -0700
Message-ID: <4E1D53230994FD45A119B5090DFBF46001A8EE08@andalusia.Galdos.local>
To: "Marco Faustinelli" <marco_faustinelli@yahoo.com>, "XSD Discussion Group W3C" <xmlschema-dev@w3.org>
You have defined a target namespace for the schema. That means the types
defined in that schema should belong to that namespace. However, you
reference those types using unqualified names. 


<xs:element name="xResponse" type="xEnvelopesResponseType"></xs:element>


That makes the validator think the type has no namespace, therefore
cannot be referenced.


You could either declared the target namespace as the default namespace
using xmlns="http://runtime.onetwo.com/schemas/xinfo
<http://runtime.onetwo.com/schemas/xinfo> ", or associate the target
namespace with a explicit prefix like 


<http://runtime.onetwo.com/schemas/xinfo> " and then prefix the type
name as follows, 


<xs:element name="xRequest"






From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org]
On Behalf Of Marco Faustinelli
Sent: Thursday, May 29, 2008 11:13 AM
To: XSD Discussion Group W3C
Subject: One element isn't referenceable, the other is!


Good morning to everybody,

Validating in Eclipse the schema attached to this email I get an error
"components with no target namespace are not referenceable", enclosed as
a whole at the end of this message.

I have found plenty of examples of this error thanks to Google, but my
schema looks fine to me to that extent.

What I don't understand is why the error is thrown only for the first
element in my XSD (xEnvelopesRequestType) and not for the second
(xEnvelopesResponseType). If I switch the position of the elements,
always the first gets the blame while the second is judged ok.

Anyway they both look fine to me, but there is something hidden that I
don't see. Can anyone help me spot it?

Thanks in advance
Marco Faustinelli - Italy

- - - - - 
Could not create Schema: src-resolve.4.1: Error resolving component
'xEnvelopesRequestType'. It was detected that 'xEnvelopesRequestType'
has no namespace, but components with no target namespace are not
referenceable from schema document
d'. If 'xEnvelopesRequestType' is intended to have a namespace, perhaps
a prefix needs to be provided. If it is intended that
'xEnvelopesRequestType' has no namespace, then an 'import' without a
"namespace" attribute should be added to
Received on Thursday, 29 May 2008 18:34:26 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:46 UTC