473,466 Members | 1,462 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

XML validation error when adding XML to a MS SQL field

2 New Member
Hi,

I have following XML-file and XML-schema:

<template xmlns="http://www.mycompany.com/xsd/PageTemplate">

...

</template>

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.mycompany.com/xsd/PageTemplate"
targetNamespace="http://www.mycompany.com/xsd/PageTemplate">
<xs:element name="template">
<xs:complexType>
...
</xs:complexType>

</xs:element>
</xs:schema>

When I create and query the XML file using LINQ, everything works just fine. I also get no compilation errors. But when I try to add the XML file to a database-field of type xml(CONTENT dbo.Common7), I get following error:

XML Validation: Declaration not found for element 'http://www.mycompany.com/xsd/PageTemplate:template'. Location: /*:template[1]

Any ideas?



Thanks,

Thomas
Sep 24 '07 #1
3 2817
jkmyoung
2,057 Recognized Expert Top Contributor
This is probably a namespace issue, eg xmlns="http://www.mycompany.com/xsd/PageTemplate"

Is there anywhere in the LINQ parser where you can set namespaces?
Sep 24 '07 #2
thomasvsundert
2 New Member
I agree that it's probably a namespace issue, but I just don't know what the problem could be.

Just to be clear: everything works just fine using LINQ. I do get the error when I validate the XML-file using the XmlReader-class (and as said when I add the XML to the database)

Thanks
Thomas
Sep 24 '07 #3
jkmyoung
2,057 Recognized Expert Top Contributor
Your namespaces match up to the letter and case in all 3 instances.

What Versions (SQL, .NET) are you using? Also, have you installed any service packs lately?
Sep 24 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email...
2
by: Dnna | last post by:
I have a table which is bound to an Internet Explorer XML data island. I'm using ASP.NET's client-side validators for an input field in the table. The problem is that if the input fields are in...
5
by: Chris | last post by:
Based upon some prevoius postings on what to do for adding a 'add' row to a datagrid I utilize the footer to create the 'add' row. The only issue is that I have it sharing the 'UpDate_Command' and...
1
by: Jack | last post by:
Hi, I have a page with a repeater control that contains textboxes. I'm trying to create a validation class that is called by my page. A method in this class iterates through all the controls...
4
by: andersoj | last post by:
I have a page that has some required field validators created in the aspx, and other validators created in the Page_Load event. In IE, all validation works as expected. In Firefox, ASPX...
9
by: julie.siebel | last post by:
Hello all! As embarrassing as it is to admit this, I've been designing db driven websites using javascript and vbscript for about 6-7 years now, and I am *horrible* at form validation. To be...
11
by: Rik | last post by:
Hello guys, now that I'm that I'm working on my first major 'open' forms (with uncontrolled users I mean, not a secure backend-interface), I'd like to add a lot of possibilities to check wether...
10
by: gweasel | last post by:
What is the best way to apply a Validation Rule - or rather, where is the best place to put it? Is there an advantage to putting it on the field in the table vs setting the validation rule on the...
5
by: lucyh3h | last post by:
Hi, I am trying to use XMLHttpRequest to do server side validation. I have several fields on a form and a submit button. The submit button has an event assocated with it when clicked. The...
7
ak1dnar
by: ak1dnar | last post by:
Hi, I got this scripts from this URL There is Error when i submit the form. Line: 54 Error: 'document.getElementbyID(....)' is null or not an object What is this error. Complete Files
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.