[xsd-users] Element '...' should be un-qualified??
Boris Kolpackov
boris at codesynthesis.com
Mon Dec 1 04:36:27 EST 2008
Hi Azadeh,
Azadeh Omrani <a.omrani at gmail.com> writes:
> <xsd:schema targetNamespace="urn:dvb:ipdc:esg:2005"
> xmlns="urn:dvb:ipdc:esg:2005"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" ... >
>
> [...]
>
> <xsd:element name="ESGMain" type="ESGMainType"/>
> <xsd:complexType name="ESGMainType">
> <xsd:sequence>
> ...
> <xsd:element name="ESG" type="ESGType" minOccurs="0"/>
> </xsd:sequence>
> </xsd:complexType>
>
> the xml instance file is like this:
>
> <ESGMain xmlns="urn:dvb:ipdc:esg:2005" ... >
> <ESG>
>
> [...]
>
> Why do you think I get the following runtime error message (in
> disgnostics_):
> "Element 'ESG' should be un-qualified" and for all the other elements
> in the TagretNamespace too...
Your XML document makes "urn:dvb:ipdc:esg:2005" the default
namespace (xmlns="urn:dvb:ipdc:esg:2005") which means that all
unqualified elements in the document are treated as belonging
to this namespace. But in your schema some local elements
(e.g., ESG) are declared as not belonging to any namespace.
If your intention is to have all elements in your vocabulary
qualified, then you can add elementFormDefault="qualified"
to the xsd:schema element. If local elements should stay
unqualified, then you will need to change your XML document
not to use the default namespace, for example:
<esg:ESGMain xmlns:esg="urn:dvb:ipdc:esg:2005" ...>
...
</esg:ESGMain>
> And another question: where can I find the "info" property about each
> error message?
I am not sure what you mean by this, but check Section 3.3,
"Error Handling" in the C++/Tree Mapping User Manual:
http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#3.3
Boris
More information about the xsd-users
mailing list