Wednesday, November 26, 2008

Normalize Space....

I'm working on a project that imports data from EPIServer to SharePoint. The solution simply reads a XML file and creates publishing pages, and uploads images based on the content.

The XML structure, and data are provided by a 3rd party vendor, so I don't have control over the content.

The import seemed to work and all the images were uploaded to SharePoint. But when the users began to insert images with formatting attributes in the img tag some spaces were added to the XML source. A quick look at the XML data in Internet Explorer did not reveal anything (Do not look at XML data in IE if you are debugging, Notepad or Notepad ++ is a much better choice).

I tried to make changes to the way XMLReader reads the document, but culd not manage to make the existing XPath query work.

To solve the problem without altering the export routine I had to make a XPath Query that included the entities with, and without the extra spaces.

Here is the XML with the space in the id attribute



The XPath query that were used in previous versions did not match the id when the space were present. A solution culd have been to just add a space in the query, but that did not seem to provide a good solution...



After searching for XML and Whitespace i found the Normalize-Space function. Problem solved!

This XPath query will return the results with or without a space

Monday, November 24, 2008

Enabling language specific help in SharePoint

When using other variations (languages) in SharePoint, the Help files may not have been installed along with the new language. (In fact I believe that the help files are never installed together with the language)

When a user requests help or seeks information the help system will display a message like the image below


The highlighted area indicates the LCID (Locale ID) that is missing its data.

In order to install the missing files you can use a command located in the SharePoint Root + Bin (12\bin) called Hcinstal.exe this application installs the help files associated with your language.

To install a single language use
Hcinstal.exe /act InstallOneHC /loc 1044 /mns MS.OSS
This will install the help files associated with LCID 1044

The utility will return one of three values to indicate the result of the operation, the codes are as follows:
  • 4 - Success
  • 32 - No action taken
  • 256 - operation failed (ex if you specify an LCID that is not installed)

After running the utility, and getting a return output like "Outcome code is: 4" the help window will now have some language specific content...




It took a while before the users reported this issue, as most "proffessionals" the users don't like to read the manuals. But when using "MySite" one link leads direct to the help files.

Welcome!

Hey make a blog, someone said. So I did...

This will be my place on the Internet to share information about the challenges I have encoutered when developing solutions using ASP.NET and/or SharePoint 2007

Regards
Christian