XML, SharePoint and the dreaded Hexadecimal Invalid Attribute

I run a site that uses SharePoint as a document repository and DotNetNuke as a viewer into that repository.  Errors are not frequent, but it is a touchy system that needs a lot of babying.  Microsoft is not fond of descriptive error messages and when it comes to SharePoint those error messages are even less descriptive.  Recently I received this error from the SharePoint list service

hexadecimal value 0x1C, is an invalid attribute character. Line 1, position ####

The problem comes when requesting an XML node list of the folders and documents in SharePoint.  However, you can’t look at the XML to see where the problem is because SharePoint won’t return the invalid XML in order to review it.  That leaves looking through each and every folder and document to find an error.

Typically, this error results from a double dot in the file name.  For example; a file that should be named “MyFile.doc” is named “MyFile..doc”  If that’s your problem, consider yourself lucky.

It was not my problem.

My problem is simple, but hidden.

After looking through all the folders and files I didn’t find any of these naming problems.

I installed CAML Designer and while it looks like a great application I couldn’t get it to connect to SharePoint.

I installed PowerGUI, but it requires a local install of SharePoint in order to connect to the libraries.  I didn’t want to do that.

So I opened the SharePoint library in Windows Explorer so that I could pull off all the files and then start adding them back one by one to find the problem file.  After going through several files I found it, but there was no obvious reason that it was a bad file.  It was a simple jpg.

I changed the name just in case a bad character was hiding in the name.  Nope.

I edited the file and resized it in hopes that it would force a change to the file and clear the bad characters.  Nope.

THE SOLUTION

I checked the properties of the bad file and there, on the Details tab, in the Comments box was the problem.  Somehow “symbol” characters found their way into the Comments box.  I cleared them, clicked OK, and low and behold the problem was gone.

This is what the bad characters will look like.  However, I still don't know how they are getting in there.

This is what the bad characters will look like. However, I still don’t know how they are getting in there.

 

Leave a Reply