有什么区别?和&#160 ;? [英] What is the difference between   and  ?
问题描述
我写了一个XSLT将xml转换为html。如果输入xml节点仅包含空格,则会使用以下代码插入空格。
< xsl:text>&#xa0 ;< / XSL:文本>
还有另外一个数字字符,它的功能也是如下所示。
< xsl:text>&#160;< / xsl:text>
这些字符有什么不同吗?有没有任何一个例子可以起作用,其他的则不行?
哪一个建议增加空间?
谢谢,
Sambhaji
&#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> </xsl:text>
There is another numeric character which also does same thing as shown below.
<xsl:text> </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
 
is a non-breaking space (
).
 
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.
这篇关于&#x00A0;有什么区别?和&#160 ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!