欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

How to use special characters in XML?

程序员文章站 2022-10-04 11:50:03
https://dvteclipse.com/documentation/svlinter/How_to_use_special_characters_in_XML.3F.html Because XML syntax uses some characters for tags and attrib ......

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 ~