title: Localization approach for XSLT + RESX in ASP.NET
body: <p>I have an ASP.NET web app where the back end data (XML format) is transformed using XSLT, producing XHTML which is output into the page.</p>
  
  <p>Simplified code:</p>
  
  <pre><code>XmlDocument xmlDoc = MyRepository.RetrieveXmlData(keyValue);
  XslCompiledTransform xsl = new XslCompiledTransform();
  xsl.Load(pathToXsl, XsltSettings.TrustedXslt, null);
  StringWriter stringWriter = new StringWriter();
  xsl.Transform(xmlDoc, null, stringWriter);
  myLiteral.Text = stringWriter.ToString();
  </code></pre>
  
  <p>Currently my XSL file contains the XHTML markup elements, as well as text labels, which are currently in English. for example:</p>
  
  <pre><code>&lt;p&gt;Title:&lt;br /&gt;
    &lt;xsl:value-of select="title"/&gt;
  &lt;/p&gt;
  &lt;p&gt;Description:&lt;br /&gt;
    &lt;xsl:value-of select="desc"/&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>I would like the text labels (Title and Description above) to be localized. I was thinking of using .NET resource files (.resx), but I don't know how the resx string resources would get pulled in to the XSLT when the transformation takes place.</p>
  
  <p>I would prefer not to have locale-specific copies of the XSLT file, since that means a lot of duplicate transformation logic.</p>
  
  <p>(NOTE: the XML data is already localized, so I don't need to change that)</p>