English 中文(简体)
WML - Entities
  • 时间:2024-12-22

WML - Entities


Previous Page Next Page  

WML entities are to represent symbols that either can t easily be typed in or that have a special meaning in WML.

For example, if you put a < character into your text normally, the browser thinks it s the start of a tag; the browser then complains when it can t find the matching > character to end the tag.

Following table displays the three forms of entities in WML. Named entities are something you may be famipar with from HTML: they look pke &amp; or &lt;, and they represent a single named character via a mnemonic name. Entities can also be entered in one of two numeric forms (decimal or hexadecimal), allowing you to enter any Unicode character into your WML.

Named EntityDecimal EntityHexa EntityCharacter
&quot;&#34;&#x22;Double quote (")
&amp;&#38;&#x26;Ampersand (&)
&apos;&#39;&#x27;Apostrophe ( )
&lt;&#60;&#x3C;Less than (<)
&gt;&#62;&#x3E;Greater than (>)
&nbsp;&#160;&#xA0;Nonbreaking space
&shy;&#173;&#xAD;Soft hyphen

Note that all entities start with an ampersand ( &) and end with a semicolon ( ;). This semicolon is very important: some web pages forget this and cause problems for browsers that want correct HTML. WAP browsers also are pkely to be stricter about errors pke these.

Advertisements