The processing instruction target matching “[xX][mM][lL]” is not allowed

if you are trying to processed an xml file and you get an error such as the one above, there are a number of things to check in the xml…

  • Visible content before the <?xml ?>  declaration. Check for rogue spaces or other characters which can be introduced especially if you have cut and paste the xml from another document.
  • Invisible characters before the <?xml ?> declaration. Check that your file is in the right format and check you have the right BOM settings.
  • An extra <?xml ?> declaration somewhere in your document. Check for any duplicates

One issue that is easy to create yourself is opening the an xml or wsdl page in internet explorer and then doing a copy and paste. You will find that explorer will format the xml to make it look pretty, and when you copy directly from explorer the additional formatting can come over with it and give you strange errors then you try and process the document.

To get past the, try and do a right click and save as, to save the document in the original format, rather than with any additional formatting

Leave a Comment

Your email address will not be published. Required fields are marked *