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 | : |
; | semi-colon | ; |
< | less than | < |
= | equals sign | = |
> | greater than | > |
? | question mark | ? |
@ | at | @ |
[ | left square bracket | [ |
\ | bbackslash | \ |
] | right square bracket | ] |
^ | caret | ^ |
_ | underscore | _ |
` | acute accent | ` |
{ | left curly brace | { |
| | vertical bar | | |
} | right curly brace | } |
~ | tilde | ~ |
上一篇: 如何评价 Vue 的 Function-based Component?
下一篇: js字符串方法