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

This is a discussion on Error :The root element of a W3C XML Schema should be <schema> - XML SOAP ; Hi, I am getting following error while validating xml file with schema using ReaderSettings in .NET 2.0 &quot;Line: 0 - Position: 0 - The root element of a W3C XML Schema should be &lt;schema&gt; and its namespace should be 'http://www.w3.org/2001/XMLSchema'.&quot; ...

+ Reply to Thread
Results 1 to 2 of 2

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

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

    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.


  2. Default Re: Error :The root element of a W3C XML Schema should be <schema>

    Manish Bafna wrote:

    > 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 to Thread

Similar Threads

  1. How to add schema to root element using msxml 6?
    By Application Development in forum XML SOAP
    Replies: 4
    Last Post: 02-17-2007, 08:25 AM
  2. Replies: 0
    Last Post: 01-25-2007, 02:15 PM
  3. Replacing element ref with actual element in schema
    By Application Development in forum XML SOAP
    Replies: 0
    Last Post: 11-14-2006, 06:14 PM
  4. xml schema validation error while creating schema collection.
    By Application Development in forum XML SOAP
    Replies: 3
    Last Post: 01-17-2006, 08:24 PM
  5. Duplicate Schema-Root folder
    By Application Development in forum Microsoft Exchange
    Replies: 0
    Last Post: 12-28-2005, 12:16 PM