XML Basic

前端之家收集整理的这篇文章主要介绍了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>
原文链接:https://www.f2er.com/xml/299229.html

猜你在找的XML相关文章