Saturday, 22 December 2007

Office 2007 - Config.xml Error - Whitespace is not allowed at this location.

For those of us with absolutely no HTML/XHTML/XML coding experience, we may run into a bit of a headache when setting up Office 2007 to install via Logon Script and Group Policy.

We may see this when proofing the Config.xml file located in the source file directory ..\OfficeVersion.WW\Config.xml:

The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and click the Refresh button, or try again later.




Whitespace is not allowed at this location. Error processing resource 'file ://mysbsserver/clientapps/office2007ent/...

Note the dotted line under the last line in the original image: ----------^

It is pointing to the space just after the actual cause of the problem.

What we need to remember is the file is coded in XML. Therefore, we need to follow XML coding rules when trying to insert special characters like the '&' ampersand in the above example.

Here is what the raw source code looks like:

Config.xml Source Code - Wrong

You can see that there is an actual '&' ampersand in the COMPANYNAME value.

A list of the codes needed for special characters like the '&' ampersand can be found here at Wikipedia: List of XML and HTML character entity references.

This is what the XML code should look like:

Config.xml Source Code - Correct

Note the "&" Ampersand+amp+Semicolon in the COMPANYNAME value. This code value will cause the XML to be rendered correctly.

Thus, after double clicking on the config.xml file, in IE you will see:

XML Correctly rendered in IE

For a complete explanation of the various settings in the config.xml file go here: TechNet: Config.xml in the 2007 Office system.

Philip Elder
MPECS Inc.
Microsoft Small Business Specialists

*All Mac on SBS posts are posted on our in-house iMac via the Safari Web browser.

No comments: