473,408 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

"element is not declared" errors when validating xml from schema

I am writing a web application for job seekers, and am adding a
section that allows administrators to upload jobs to the system via
xml. I have used an xml schema to validate the xml they upload. The
website runs on IIS5 using classic ASP, and the xml validation is done
in a .NET component written in C# that is registered for COM interop
on the webserver.

I have a test application to test the .NET component, and that
application does not give any errors, however, when I run it in the
web application, it keeps coming back with errors on every element.

It just started having problems today, so I assume it's caused by some
change I made recently, but I can't figure out what.

The errors I get back are as follows:

The 'http://www.w3.org/2001/XMLSchema:schema' element is not declared.
An error occurred at , (2, 2).
The 'version' attribute is not declared. An error occurred at , (2,
12).
The 'id' attribute is not declared. An error occurred at , (2, 71).
The 'http://www.w3.org/2001/XMLSchema:simpleType' element is not
declared. An error occurred at , (4, 3).
The 'name' attribute is not declared. An error occurred at , (4, 17).
The 'http://www.w3.org/2001/XMLSchema:restriction' element is not
declared. An error occurred at , (5, 4).
The 'http://www.w3.org/2001/XMLSchema:restriction' element is not
declared. An error occurred at , (5, 4).
The 'http://www.w3.org/2001/XMLSchema:enumeration' element is not
declared. An error occurred at , (6, 5).
......

the xml I am trying to validate is:

<?xml version="1.0" encoding="UTF-8" ?>
<Jobs>
<schemaVersion>1.10</schemaVersion>
<JobRecord>
<JobID>1</JobID>
<JobIDIsNew>true</JobIDIsNew>
<JobDocType>53</JobDocType>
<JobDocument>asdf</JobDocument>
.......

against this schema:

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema version="1.10" xmlns:xs="http://www.w3.org/2001/XMLSchema"
id="JobDataSet">
<xs:element name="Jobs">
<xs:complexType>
<xs:sequence>
<xs:element name="schemaVersion" type="xs:decimal" />
<xs:element name="JobRecord" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="JobID" type="xs:integer" minOccurs="1"
maxOccurs="1" />
<xs:element name="JobIDIsNew" type="xs:boolean" minOccurs="1"
maxOccurs="1" />
<xs:element name="JobDocType" type="JobDocTypeType"
minOccurs="1" maxOccurs="1" />
<xs:element name="JobDocument" type="xs:string" minOccurs="1"
maxOccurs="1" />
......

any help would be greatly appreciated.
Nov 12 '05 #1
1 18274
My mistake, it turned out I was passing the wrong xml to the validation
routine rather - it was the schema xml!

Derek wrote:
I am writing a web application for job seekers, and am adding a
section that allows administrators to upload jobs to the system via
xml. I have used an xml schema to validate the xml they upload. The
website runs on IIS5 using classic ASP, and the xml validation is done in a .NET component written in C# that is registered for COM interop
on the webserver.

I have a test application to test the .NET component, and that
application does not give any errors, however, when I run it in the
web application, it keeps coming back with errors on every element.

It just started having problems today, so I assume it's caused by some change I made recently, but I can't figure out what.

The errors I get back are as follows:

The 'http://www.w3.org/2001/XMLSchema:schema' element is not declared. An error occurred at , (2, 2).
The 'version' attribute is not declared. An error occurred at , (2,
12).
The 'id' attribute is not declared. An error occurred at , (2, 71).
The 'http://www.w3.org/2001/XMLSchema:simpleType' element is not
declared. An error occurred at , (4, 3).
The 'name' attribute is not declared. An error occurred at , (4, 17).
The 'http://www.w3.org/2001/XMLSchema:restriction' element is not
declared. An error occurred at , (5, 4).
The 'http://www.w3.org/2001/XMLSchema:restriction' element is not
declared. An error occurred at , (5, 4).
The 'http://www.w3.org/2001/XMLSchema:enumeration' element is not
declared. An error occurred at , (6, 5).
.....

the xml I am trying to validate is:

<?xml version="1.0" encoding="UTF-8" ?>
<Jobs>
<schemaVersion>1.10</schemaVersion>
<JobRecord>
<JobID>1</JobID>
<JobIDIsNew>true</JobIDIsNew>
<JobDocType>53</JobDocType>
<JobDocument>asdf</JobDocument>
......

against this schema:

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema version="1.10" xmlns:xs="http://www.w3.org/2001/XMLSchema"
id="JobDataSet">
<xs:element name="Jobs">
<xs:complexType>
<xs:sequence>
<xs:element name="schemaVersion" type="xs:decimal" />
<xs:element name="JobRecord" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="JobID" type="xs:integer" minOccurs="1"
maxOccurs="1" />
<xs:element name="JobIDIsNew" type="xs:boolean" minOccurs="1"
maxOccurs="1" />
<xs:element name="JobDocType" type="JobDocTypeType"
minOccurs="1" maxOccurs="1" />
<xs:element name="JobDocument" type="xs:string" minOccurs="1"
maxOccurs="1" />
.....

any help would be greatly appreciated.


Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ReignMan | last post by:
I'm running JDK 1.4.0_01, Xalan2.5.1 and Tomcat 4.1.27. XSL transformations work, yet when running in debug mode (Eclipse IDE), I get the following: 990S2html.xsl:3:80: Element type...
4
by: Jamie Jackson | last post by:
I'm trying to limit the space between an <h1> and an <h2>, which immediately follows. Isn't there some syntax for this? <h1>Main Header</h1> <h2>Sub Header</h2> There's too much space between...
2
by: MiW | last post by:
Hi I'm making a kind of JavaScript-based library for creating SVG objects/elements. And I hit the wall... Every element (rect, circle etc.) can be created using *.createElement, then...
1
by: Bimal | last post by:
Hi, I upgraded my gcc from 2.95 to 3.3. When I compile some projects I get error messages saying... /usr/local/include/c++/3.3/ctime:68: error: `tm' not declared...
4
by: Tom Eldridge | last post by:
Hi all I'm getting tons of these errors when running the w3c validator on my template page. Basically it will say for example: element "TITLE" undefined. Do I need to put this into lowercase...
1
by: tankbattle | last post by:
That is, what's the difference between <complexType name="Address" final="restriction"> <sequence> <element name="name" type="string"/> <element name="street" type="string"/> <element...
2
by: Monty | last post by:
Hello, I have a label control in my master page like this: <asp:Label ID=lblStatusMessage runat="server"></asp:Label> When I reference the control in my code-behind I get this error "Name...
17
by: Juha Nieminen | last post by:
As we know, the keyword "inline" is a bit misleading because its meaning has changed in practice. In most modern compilers it has completely lost its meaning of "a hint for the compiler to inline...
5
by: AAaron123 | last post by:
The aspx file includes the following: <asp:LoginView ID="LoginView1" Runat="server"> <LoggedInTemplate> <fieldset> <asp:label id="message1" runat="server" />
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.