You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Reiko Koehler <Re...@gmx.net> on 2003/02/04 15:45:12 UTC
cvc-elt.1: Cannot find the declaration of element 'ROOT'
Hi all,
I wonder what I am doing wrong:
I want to validate the following XML file:
<ROOT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://localhost:8080/axis http://localhost:8080/axis/schema.xsd">
<TAG_A>
...
</TAG_A>
...
</ROOT>
using the following "schema.xsd" file:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://localhost:8080/axis" xmlns="http://localhost:8080/axis"
elementFormDefault="qualified">
<xsd:annotation>
<xsd:documentation xml:lang="en">Description of this document
</xsd:documentation>
</xsd:annotation>
<xsd:element name="ROOT">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="TAG_A" type="AType" minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element name="TAG_B" type="BType" minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element name="TAG_C" type="CType" minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element name="TAG_D" type="DType" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="AType">
<xsd:all>
<xsd:element name="AElem1" type="xsd:decimal" minOccurs="0"/>
.....
<xsd:element name="AElemLast" type="xsd:decimal" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="BType">
...
</xsd:complexType>
...
</xsd:schema>
It results in the message:
cvc-elt.1: Cannot find the declaration of element 'ROOT'.
Can anybody tell me the reason?
Thanks,
Reiko
--
+++ GMX - Mail, Messaging & more http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
Re: cvc-elt.1: Cannot find the declaration of element 'ROOT'
Posted by Andreas Fischbach <an...@sicad.de>.
Reiko Koehler wrote:
>Hi all,
>
>I wonder what I am doing wrong:
>
>I want to validate the following XML file:
>
><ROOT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>xsi:schemaLocation="http://localhost:8080/axis http://localhost:8080/axis/schema.xsd">
><TAG_A>
> ...
></TAG_A>
>...
></ROOT>
>
>using the following "schema.xsd" file:
>
><?xml version="1.0" encoding="UTF-8"?>
><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>targetNamespace="http://localhost:8080/axis" xmlns="http://localhost:8080/axis"
>elementFormDefault="qualified">
>
> <xsd:annotation>
> <xsd:documentation xml:lang="en">Description of this document
></xsd:documentation>
> </xsd:annotation>
> <xsd:element name="ROOT">
> <xsd:complexType>
>
Should be
<xsd:element name="ROOT" type="RootType">
<xsd:complexType name="RootType">
Not checked, but i think this was the mistake.
Greetings Andreas
> <xsd:sequence>
> <xsd:element name="TAG_A" type="AType" minOccurs="0"
>maxOccurs="unbounded"/>
> <xsd:element name="TAG_B" type="BType" minOccurs="0"
>maxOccurs="unbounded"/>
> <xsd:element name="TAG_C" type="CType" minOccurs="0"
>maxOccurs="unbounded"/>
> <xsd:element name="TAG_D" type="DType" minOccurs="0"
>maxOccurs="unbounded"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> <xsd:complexType name="AType">
> <xsd:all>
> <xsd:element name="AElem1" type="xsd:decimal" minOccurs="0"/>
> .....
> <xsd:element name="AElemLast" type="xsd:decimal" minOccurs="0"/>
> </xsd:all>
> </xsd:complexType>
> <xsd:complexType name="BType">
> ...
> </xsd:complexType>
> ...
></xsd:schema>
>
>
>It results in the message:
>
>cvc-elt.1: Cannot find the declaration of element 'ROOT'.
>
>Can anybody tell me the reason?
>
>Thanks,
>Reiko
>
>
>
--
-----------------------------------------------------------------------
Dipl. -Ing. (FH) Andreas Fischbach RD3 Entwicklung / ALKIS
SICAD Geomatics Tel +49 (89) 45026 248
Lilienthalstraße 7 Fax +49 (89) 45026 206
85579 Neubiberg /Muenchen / Germany Raum G 2.08
mailto:andreas.fischbach@sicad.de http://www.sicad.de
-----------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
Re: cvc-elt.1: Cannot find the declaration of element 'ROOT'
Posted by George Cristian Bina <ge...@sync.ro>.
Hi,
At a first glance it seems you are defining the ROOT element as belonging to
the http://localhost:8080/axis namespace while in the instance document it
belongs to no namespace. Try to add a xmlns="http://localhost:8080/axis" to
the ROOT element in your instance document.
All the best,
George
-------------------------------------------------------------
George Cristian Bina mailto:george@sync.ro
COO - sync.ro
Phone +40-(0)251-461480, +40-(0)251-461481
Fax +40-(0)251-461482
Mobile +40-(0)723-224067
SyncRO Soft srl, Bd N. Titulescu 170, Craiova, 1100 - Romania
http://www.sync.ro
<oXygen/> XML Editor - http://www.oxygenxml.com/
----- Original Message -----
From: "Reiko Koehler" <Re...@gmx.net>
To: <xe...@xml.apache.org>
Sent: Tuesday, February 04, 2003 4:45 PM
Subject: cvc-elt.1: Cannot find the declaration of element 'ROOT'
> Hi all,
>
> I wonder what I am doing wrong:
>
> I want to validate the following XML file:
>
> <ROOT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://localhost:8080/axis
http://localhost:8080/axis/schema.xsd">
> <TAG_A>
> ...
> </TAG_A>
> ...
> </ROOT>
>
> using the following "schema.xsd" file:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://localhost:8080/axis"
xmlns="http://localhost:8080/axis"
> elementFormDefault="qualified">
>
> <xsd:annotation>
> <xsd:documentation xml:lang="en">Description of this document
> </xsd:documentation>
> </xsd:annotation>
> <xsd:element name="ROOT">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="TAG_A" type="AType" minOccurs="0"
> maxOccurs="unbounded"/>
> <xsd:element name="TAG_B" type="BType" minOccurs="0"
> maxOccurs="unbounded"/>
> <xsd:element name="TAG_C" type="CType" minOccurs="0"
> maxOccurs="unbounded"/>
> <xsd:element name="TAG_D" type="DType" minOccurs="0"
> maxOccurs="unbounded"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> <xsd:complexType name="AType">
> <xsd:all>
> <xsd:element name="AElem1" type="xsd:decimal" minOccurs="0"/>
> .....
> <xsd:element name="AElemLast" type="xsd:decimal" minOccurs="0"/>
> </xsd:all>
> </xsd:complexType>
> <xsd:complexType name="BType">
> ...
> </xsd:complexType>
> ...
> </xsd:schema>
>
>
> It results in the message:
>
> cvc-elt.1: Cannot find the declaration of element 'ROOT'.
>
> Can anybody tell me the reason?
>
> Thanks,
> Reiko
>
> --
> +++ GMX - Mail, Messaging & more http://www.gmx.net +++
> NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org