开发者

Can you use character codes in XML?

I referenced this website: http://biega.com/special-char.html to aid me in adding special characters in my XML. But to no avail.

Here is what I am doing:

In my XML I have attempted to add special characters like such:

<inc_1c>
<Url>http://www.google.com</Url>
<Title>This is some content &#187;</Title>
</inc_1c>

When I go to the browser it displays a broken special char symbol: �.

Initially I tried:

<Title>This is some content &raquo;</Title>

No dice. Anyone have any suggestions?

**Update: I should probably mention, this XML file is working with an XSL file for styles... Then its being pulled into 开发者_如何学编程an .ASPX page and displayed there.


Consider adding / adjusting the <meta charset="">, either <meta charset="ISO-8859"> or <meta charset="utf-8">


I cannot reproduce this behavior using Firefox or IE8:

<html>
<body>
&#187;<br>
&raquo;<br>
&#xbb;
</body>
</html>

All three versions work as expected. I suspect your browser may not support Unicode, or the font it's using doesn't have this character in it.


Have you tried using &#xbb; ?

  • 187 is decimal, bb is the same value in hexadecimal (hence the extra x)
  • Got this idea from http://unicode.org/reports/tr20/
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜