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:[EMAIL PROTECTED]                   http://www.sicad.de
-----------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to