xml

时间:2020-03-05 09:50:39   收藏:0   阅读:59

XML

一、简介

XML 被设计用来传输和存储数据。

HTML 被设计用来显示数据。

二、XML 是不作为的

三、XML 文档形成一种树结构

XML 文档必须包含根元素。该元素是所有其他元素的父元素。XML 文档中的元素形成了一棵文档树。这棵树从根部开始,并扩展到树的最底端。

所有元素均可拥有子元素:

<root>
  <child>
    <subchild>.....</subchild>
  </child>
</root>

四、语法

<note date="08/08/2008">
<to>George</to>
<from>John</from>
</note> 

可扩展性

<note>
<to>George</to>
<from>John</from>
<body>Don't forget the meeting!</body>
</note> 

让我们设想一下,我们创建了一个应用程序,可将 以及 元素提取出来,并产生以下的输出:

MESSAGE
To: George
From: John

Don't forget the meeting!

想象一下,之后这个 XML 文档作者又向这个文档添加了一些额外的信息:

<note>
<date>2008-08-08</date>
<to>George</to>
<from>John</from>
<heading>Reminder</heading>
<body>Don't forget the meeting!</body>
</note>

那么这个应用程序会中断或崩溃吗?

不会!

原文:https://www.cnblogs.com/friedCoder/p/12418214.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!