HighTechTalks DotNet Forums  

Error :The root element of a W3C XML Schema should be <schema>

Dotnet XML microsoft.public.dotnet.xml


Discuss Error :The root element of a W3C XML Schema should be <schema> in the Dotnet XML forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Manish Bafna
 
Posts: n/a

Default Error :The root element of a W3C XML Schema should be <schema> - 12-12-2007 , 08:51 AM






Hi,
I am getting following error while validating xml file with schema using
ReaderSettings in .NET 2.0
"Line: 0 - Position: 0 - The root element of a W3C XML Schema should be
<schema> and its namespace should be 'http://www.w3.org/2001/XMLSchema'."
First few lines of xsd file are as follows:
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://schemas.keaneaustralia.com/Nts"
elementFormDefault="qualified"
targetNamespace="http://schemas.keaneaustralia.com/Nts" >
<xsd:element name="DeviceParameters" nillable="true"
type="tnseviceParameters" />
<xsd:complexType name="DeviceParameters">
<xsd:complexContent mixed="false">
<xsd:extension base="tnsataElementOfDeviceParameter">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded"
name="DeviceParameter" type="tnseviceParameter" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
.........
I am not able understand why the error is coming.Any help would be highly
appreiciated.I have searched high and low on internet but not able to find
any useful
Thanks in advance for replying(as always)
--
Hope this helps.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.


Reply With Quote
  #2  
Old   
Martin Honnen
 
Posts: n/a

Default Re: Error :The root element of a W3C XML Schema should be <schema> - 12-12-2007 , 09:00 AM






Manish Bafna wrote:

Quote:
I am getting following error while validating xml file with schema using
ReaderSettings in .NET 2.0
"Line: 0 - Position: 0 - The root element of a W3C XML Schema should be
schema> and its namespace should be 'http://www.w3.org/2001/XMLSchema'."
First few lines of xsd file are as follows:
?xml version="1.0" encoding="utf-8"?
xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://schemas.keaneaustralia.com/Nts"
elementFormDefault="qualified"
targetNamespace="http://schemas.keaneaustralia.com/Nts"
It sounds to me as if your application is loading something supposed to
be a schema but in reality it loads something different. So double check
that you are really loading the schema you have shown.
You might also want to show us your code performing the validation.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.