如何显示在XML输出中 [英] How to display   in XML output

查看:77
本文介绍了如何显示在XML输出中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用XSLT生成XML输出.我需要在XML输出中显示 .我尝试了一些显示 的选项,但它显示了 .有人可以帮我解决这个问题吗?

I am generating the XML output using XSLT. I need to display   in the XML output. I have tried few options to display   but it displays  . Can anyone help me on this issue?

谢谢.

推荐答案

除非您的XML具有DTD来说明 的含义,否则您不能使用 .在HTML中使用此代码的唯一原因是XHTML DTD定义了它的含义(对于XHTML),或者它刚被烘焙到解析器(HTML)中.

Unless your XML has a DTD which says what   means, you cannot use  . The only reason this works in HTML is because the XHTML DTD defines what it means (for XHTML) or it's just baked in to the parser (HTML).

通常,您不应在XML中使用命名字符实体,因为如果没有DTD,就无法正确分析此类文档. (而且DTD麻烦很多.)直接使用字符,或使用数字字符引用.

In general you should not use named character entities in XML because such documents cannot be parsed properly without their DTD. (And DTDs are a big hassle.) Use the character directly, or use a numeric character reference.

对于不间断的空格,可以使用  ,它们分别是十进制和十六进制unicode代码点编号.

For a non-breaking space, you can use   or  , which are the decimal and hexadecimal unicode code point numbers respectively.

这篇关于如何显示在XML输出中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆