472,805 Members | 1,136 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 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 18031
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: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.