正在修改的文本 - 特殊字符

时间:2011-07-27 17:25:55

标签: c# xslt google-search google-search-appliance

我的XML中有一个项目会返回如下标记:<MT N="firstName" V="Nataša"/>

然后我用这两种方式展示它:

<xsl:variable name="firstName" select="MT[@N = 'firstName']/@V"/>
<img src="{$headshotUrl}" alt="{$firstName} {$lastName}" />
<xsl:value-of select="$firstName" />

正在输出的最终结果是Nataa,并且正在Chrome中完全删除重音S.看起来我在不同的浏览器中得到了不同的结果,但没有一个正确显示字符。

页面设置为UTF-8,因此应该没有问题。

有什么想法吗?

更新

转换正在C#中应用,如下所示:

string qs = "http://" + System.Configuration.ConfigurationManager.AppSettings["GoogleIP"] + "/search?" + query;

XmlDocument xmlDocument = new XmlDocument();
XPathDocument xpathDoc = new XPathDocument(qs);

if(!String.IsNullOrEmpty(XSLToLoad))
{
     XslCompiledTransform transform = new XslCompiledTransform();

     //Load the XSL stylsheet into the Transform object
     transform.Load(XSLToLoad);

     //Create a StringWriter object to hold the result
     StringWriter sw;
     sw = new StringWriter();
     //update parameter if needed
     XsltArgumentList xslArg = AddPageParams();

     //Perform the Transform
     transform.Transform(xpathDoc, xslArg, sw);

     //Assign result to asp label
     litResults.Text = sw.ToString();
}

0 个答案:

没有答案
相关问题