While working on yesterday’s article, I ran into several issues attempting to import my Sitemap.
Since I wasn’t exactly sure what it was, I decided to turn on CRM Tracing to track down the internal error. Here is what I found in the trace logs:
Crm Exception: Message: The import file is invalid. XSD validation failed with the following error: ”=’ is an unexpected token. The expected token is ‘;’. Line 74, position 74.’.
Really? That sounds bad.
Here is the really cool change they made to CRM 2011 tracing:
<SubArea Id="new_vendorsx" Url="/main.aspx?etn=account&pagetype <<<<<ERROR LOCATION>>>>> =entitylist&viewid=%7b2C598CB7-2E3F-DE11-8035-0050569A36D3%7d&viewtype=1039">
As you can see, the trace file had the exact location of the error.
In this particular case, it turns out I had forgot to encode the ampersand character which was being interpreted as an XML literal and causing the XML validation to fail.