How to use special characters in XML?

2019-11-23 16:01:09来源:博客园 阅读 ()

新老客户大回馈,云服务器低至5折

How to use special characters in XML?

https://dvteclipse.com/documentation/svlinter/How_to_use_special_characters_in_XML.3F.html

 

Because XML syntax uses some characters for tags and attributes it is not possible to directly use those characters inside XML tags or attribute values.

To include special characters inside XML files you must use the numeric character reference instead of that character. The numeric character reference must be UTF-8 because the supported encoding for XML files is defined in the prolog as encoding="UTF-8" and should not be changed.

The numeric character reference uses the format:

&#nn; decimal form

&#xhh; hexadecimal form

Code Name Displayed as
	 Horizontal tab non-printing

 Line feed non-printing

 Carriage Return non-printing
  Space non-printing
! Exclamation mark !
" Quotation mark "
# Number sign #
$ Dollar sign $
% Percent sign %
& Ampersand &
' Apostrophe '
( Left parenthesis (
) Right parenthesis )
* Asterisk *
+ Plus sign +
, Comma ,
- Hyphen -
. Period .
/ Slash /
: Colon :
&#59; Semi-colon ;
&#60; Less than <
&#61; Equals sign =
&#62; Greater than >
&#63; Question mark ?
&#64; At @
&#91; Left square bracket [
&#92; Bbackslash \
&#93; Right square bracket ]
&#94; Caret ^
&#95; Underscore _
&#96; Acute accent `
&#123; Left curly brace {
&#124; Vertical bar |
&#125; Right curly brace }
&#126; Tilde ~

原文链接:https://www.cnblogs.com/kungfupanda/p/11917418.html
如有疑问请与原作者联系

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:HTML连载52-网易注册界面之上部完成、中部初探

下一篇:UML:类图关系总结