XML Basic

XML声明:

<?xml version="1.0" encoding="UTF-8"?>


XML中属性的value值要被引号(单引号or双引号)引起来,如:

<note date="12/11/2007">
  <to>Tove</to>
  <from>Jani</from>
</note>


XML元素中有<,>,&,'," 时用实体引用:

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

<message>if salary < 1000 </message>
错误;

<message>if salary &lt; 1000</message>
正确。


XML中的注释:

<!-- this is a comment -->

空的XML元素:

<book></book>
<book />

matadata可以用属性来描述,data用元素来描述。


解决命名冲突:

<h:table>
  <h:tr>
    <h:td>Apples</h:td>
    <h:td>Bananas</h:td>
  </h:tr>
</h:table>

<f:table>
  <f:name>African Coffee Table</f:name>
  <f:width>80</f:width>
  <f:length>120</f:length>
</f:table>


posted @ 2014-01-20 23:59  evashi  阅读(188)  评论(0编辑  收藏  举报