BizTalk Schemas – Unexpected XML declaration. The XML declaration must be the first node in the document, and no white space characters are allowed to appear before it

Posted: October 10, 2010 in BizTalk
Tags: , ,

Today I found am error in MSDN forum that I encountered and suffered with him in the past:

“Unexpected XML declaration. The XML declaration must be the first node in the document, and no white space characters are allowed to appear before it. Line 1, position 4.”

CAUSE

  • You have a single whitespace character on the first line of your schema before the start of the xml declaration.

Or

  • You have a single whitespace character on the first line of your XML file before the start of the xml declaration.

SOLUTION 1

  • Open your XSD file in Notepad and remove the character, save and then re-validate- the problem should go away.

SOLUTION 2

  • When using XML file you must start declaration in the first row with <?xml version="1.0" encoding="UTF-8" ?> right away. No space is allowed in the beginning of the xml file.

Tags: BizTalk | Schemas | Errors and Warnings, Causes and Solutions

Comments
  1. Rushabh Rakholiya says:

    great….i was did this error from last two days…now solved it..thanks

  2. Nishant Vishwakarma says:

    I am facing this issue while calling a WCF service. surprisingly the message states Line(44,9) or Line(46,9) when the request is not more than 26 lines. I am still clueless. Can anyone share their experience

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s