Solved

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

Posted on 2010-09-13
1
4,549 Views
Last Modified: 2012-08-13
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~
0
Comment
Question by:IzzyTwinkly
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
David Christal CISSP earned 500 total points
ID: 33668493
try this:

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>'
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sql query help 15 52
find SQL job run average duration 24 55
sql select total by week ending 3 24
T-SQL: Need Group By to use "fuzzy logic"?? 3 18
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question