IzzyTwinkly
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.xmlProjectSchemaCollec tion 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~
I am trying to create xml schema collection as follow:
use xmltest
create xml schema collection dbo.xmlProjectSchemaCollec
'
<?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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.