Link to home
Start Free TrialLog in
Avatar of IzzyTwinkly
IzzyTwinklyFlag for United States of America

asked on

XML parsing: line 2, character 6, text/xmldecl not at the beginning of input

Hi,

I am trying to create xml schema collection as follow:
use xmltest

create xml schema collection dbo.xmlProjectSchemaCollection as
'
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="project">
      <xs:complexType>
       <xs:sequence>
      <xs:element name="projectnumber" type="xs:int"/>
      <xs:element name="projectname" type="xs:string"/>
      <xs:element name="startdate" type="xs:date"/>
      <xs:element name="enddate" type="xs:date"/>
      <xs:element name="manager" type="xs:string"/>
      <xs:element name="scope" type="xs:string"/>
       </xs:sequence>
      </xs:complexType>
</xs:element>
</xs:schema>
'
However I am getting the following error when I executed the code above:
XML parsing: line 2, character 6, text/xmldecl not at the beginning of input

Why am I getting this error?   Could you please tell me how to fix?

Thanks~
ASKER CERTIFIED SOLUTION
Avatar of David Christal CISSP
David Christal CISSP

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial