4

I set up Eclipse with the Force.com IDE, and made some changes to Contact.Object. When I try to deploy it, I get this error: Problem: Error parsing file: The processing instruction target matching "[xX][mM][lL]" is not allowed.

This is the first time I'm using Eclipse with Salesforce, so I have no clue what it means. Can anyone help me?

Thanks!

Edit: My xml file: https://www.dropbox.com/s/czbrc7eoqv01xb0/Contact.object

2
  • What specific changes were made to the XML file? There is something wrong with its new structure, unbalanced tags, improper case of a tag, improper nesting, etc.
    – Mark Pond
    Commented Sep 12, 2013 at 16:54
  • I added some custom fields that I copied from Leads
    – user3515
    Commented Sep 12, 2013 at 17:47

2 Answers 2

0

Try to refresh your project from Salesforce server. If you have made changes, probably copy it to a test file before refresh and once the refresh is complete, you can restore from the temporary text file to your eclipse ide. I had the same problem a while ago and refreshing from the server fixed it.

5
  • That's what I just did!
    – user3515
    Commented Sep 12, 2013 at 16:41
  • 1
    I guess refreshing didn't solve your problem. Can you post the xml from the file that is causing the problem (....-meta.xml)? Commented Sep 12, 2013 at 17:04
  • Sure! See above.
    – user3515
    Commented Sep 12, 2013 at 17:41
  • The file that you uploaded has two <?xml...> tags, one at line # 1 and another at line # 2053. This is not allowed in xml. In my opinion, the quickest and easiest way to fix this is to copy the code to notepad and delete this file in Salesforce and recreate and copy the code from your notepad. Or you can just remove the second set of <?xml...> (starting from line # 2053 to the end). Commented Sep 12, 2013 at 17:51
  • That was it! I guess when I pasted my code back into it (after copying it out to get rid of any nonprinting characters) I must have pressed control-v twice!
    – user3515
    Commented Sep 12, 2013 at 19:26
4

This error occurs when a xml file has been malformed or generated wrong.

Open you Contact.object file and remove all white spaces before

<?xml version 1.0...> tag. You cannot add space before starting tag of a xml file.

Update:

Basically these these type of error are very hard to find.

The easiest way way get you previous working copy of that file and compare it,

If you cant do this then the only way is:

  • Read the xml proc-types is it in correct format or not . proc-types

  • Check for all tags ate they started and closed properly?

  • Are their same unprintable characters (Notepad++ will help in that) also what are the unprintable characters for an xml file? Here is answer

That the only help we can provide. Also if it is possible to post that xml file then we could help some. Salesforce object files have fixed format which should be maintain to save that file properly means <fields>, <listViews>, <searchLayouts>, <actionOverrides> in <CustomObject xmlns="http://soap.sforce.com/2006/04/metadata"> tag.

3
  • Thanks for your reply. There is no white space before the xml tag, though. Any ideas?
    – user3515
    Commented Sep 12, 2013 at 15:50
  • This also happens sometimes when your xml file contains unprintable character in it.
    – Ashwani
    Commented Sep 12, 2013 at 16:35
  • How could I find them?
    – user3515
    Commented Sep 12, 2013 at 16:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .