Blank Line as first line of .xml document will cause a Parse Error

By: Angel Martinez

Abstract: Describes what happens when using an .xml file with a blank line as the first line in the document with a XMLTransformProvider


When using a TXMLTransformProvider with a XML file that contains a blank line as the first line in the document, the following error is raised:

XML Parse Error: Invalid xml declaration
Reason: Invalid xml declaration.
Error on line 2, position 3.


If you try opening up the .xml document inside Internet Explorer, you will not see the blank line. Open up the .xml file inside notepad or some similiar text editor. Delete the blank line at the top of the document and ensure the first line is the XML Identifier. This must appear at the start of the document as this allows a processor to read the first few bytes to determine which family of schemes is in use.

Server Response from: ETNASC01