XML-Entity References

来源:互联网 发布:js数组对象常用方法 编辑:程序博客网 时间:2024/06/07 16:17

http://www.w3schools.com/xml/xml_syntax.asp

Entity References

 

This will generate an XML error:

<message>if salary < 1000 then</message>

To avoid this error, replace the "<" character with an entity reference:

<message>if salary &lt; 1000 then</message>

There are 5 predefined entity references in XML:

&lt;<less than&gt;>greater than&amp;&ampersand &apos;'apostrophe&quot;"quotation mark

Note: Only the characters "<" and "&" are strictly illegal in XML. The greater than character islegal, but it is a good habit to replace t.

原创粉丝点击