有什么区别?和&#160 ;? [英] What is the difference between   and  ?

查看:547
本文介绍了 有什么区别?和&#160 ;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个XSLT将xml转换为html。如果输入xml节点仅包含空格,则会使用以下代码插入空格。

 < xsl:text>&#xa0 ;< / XSL:文本> 

还有另外一个数字字符,它的功能也是如下所示。

 < xsl:text>&#160;< / xsl:text> 

这些字符有什么不同吗?有没有任何一个例子可以起作用,其他的则不行?

哪一个建议增加空间?



谢谢,

Sambhaji

p>

解决方案

&#160; 非破坏性空间& nbsp; )。



&#xa0; 只是相同,但采用十六进制(在 HTML实体中, x 字符显示十六进制数即将到来)。基本上没有区别, A0 160 是不同基数的相同数字。



你应该决定你是否真的需要一个不间断的空间,或者一个简单的空间就足够了。


I have written one XSLT to transform xml to html. If input xml node contains only space then it inserts the space using following code.

<xsl:text>&#xa0;</xsl:text>

There is another numeric character which also does same thing as shown below.

<xsl:text>&#160;</xsl:text>

Is there any difference between these characters? Are there any examples where one of these will work and other will not?

Which one is recommended to add space?

Thanks,
Sambhaji

解决方案

&#160; is a non-breaking space (&nbsp;).

&#xa0; is just the same, but in hexadecimal (in HTML entities, the x character shows that a hexadecimal number is coming). There is basically no difference, A0 and 160 are the same numbers in a different base.

You should decide whether you really need a non-breaking space, or a simple space would suffice.

这篇关于&amp;#x00A0;有什么区别?和&#160 ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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