Monday, November 16, 2009

XsltUrlEncodingInDotNet

I've tried to find out the smartest way to url-encode a string in Xslt (through .NET). To my surprise I must say that the easiest and fastest way to solve the problem was not through clean xslt, but rather through the use of jscript.

    <msxsl:script language="JScript" implements-prefix="xmlnamespaceofchoice">
        <![CDATA[
        function urlEncode(strURL)
        {
       
            return encodeURIComponent(strURL);
        }
    ]]>
    </msxsl:script>

and then calling the
<xsl:value-of select="xmlnamespaceofchoice:urlEncode(string(//myElement))" />

voila


Friday, November 6, 2009

Sitecore editor hassles

Recently I experienced an extremely annoying error which occurred
within the sitecore editor:

"Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: no segments* file
found in Sitecore.Data.Indexing.FSDirectory@D:\Inet\Websites\Development\Website\indexes\master\system:
files:
"

Just a plain .NET Exception page... What caused the error?

/*TODO: description LUCENE, stackoverflow,*/

FIX:
Goto sitecore "control panel", choose "Database" and "Rebuild the
Search Index" and reload sitecore. Done :)