title: Adding localization to XSLT
body: <p>I'm using an XSL file to do the rendering of an ASP.NET webpart that I made, but now I want to localize the strings inside that XSL file:</p>
  
  <pre><code>&lt;xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:siteInfo="urn:siteInfo" version="1.0"&gt;
    &lt;xsl:output method="html" omit-xml-declaration="no"/&gt;
    &lt;xsl:template match="*|/"&gt;
      &lt;p&gt;
       Project name: &lt;xsl:value-of select="siteInfo:GetProjectName()"/&gt;
      &lt;/p&gt;
  </code></pre>
  
  <p>In the above example I want to localize "Project name".
  The language in which I'm working is C# and this is the snippet I use for transforming:</p>
  
  <pre><code>XslCompiledTransform transformationEngine = new XslCompiledTransform();
  XmlUrlResolver resolver = new XmlUrlResolver();
  resolver.Credentials = CredentialCache.DefaultNetworkCredentials;
  transformationEngine.Load(XslUrl, new XsltSettings(true, true), resolver);
  XsltArgumentList args = new XsltArgumentList();
  args.AddExtensionObject("urn:siteInfo", siteInfo);
  transformationEngine.Transform(xmlDocument, args, ms);
  </code></pre>
  
  <p>Is it possible to do localization through resource (resx) files in that XSL file? In the rest of my project I'm using the following line to insert localized strings:</p>
  
  <pre><code>HttpContext.GetGlobalResourceObject(resourceName, resourceKey).ToString();
  </code></pre>
  
  <p>Kind regards,</p>
  
  <p>Jeroen</p>