加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

XML Basic

发布时间:2020-12-16 05:08:00 所属栏目:百科 来源:网络整理
导读:XML声明: ?xml version="1.0" encoding="UTF-8"? XML中属性的value值要被引号(单引号or双引号)引起来,如: note date="12/11/2007" toTove/to fromJani/from/note XML元素中有,,,'," 时用实体引用: lt; less than gt; greater than amp; ampersand apos

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>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读