可扩展标记语言xml总结_可扩展标记语言(XML)简介

可扩展标记语言xml总结

XML stands for eXtensible Markup Language. It is extensible, because unlike HTML, it does not use a predefined set of tags for identifying structural components. Instead, it provides a mechanism for users to define tags themselves.

XML代表可扩展标记语言。 它是可扩展的,因为与HTML不同,它不使用预定义的标签集来标识结构组件。 相反,它为用户提供了一种自行定义标签的机制。

XML was designed to simplify data sharing and data transport, and focuses on structuring that information in a logical way.

XML旨在简化数据共享和数据传输,并致力于以逻辑方式构造信息。

XML的语法 (Syntax of XML)

The syntax for XML is very straight forward and quite easy to learn.

XML的语法非常简单,而且很容易学习。

XML documents must contain one root element that is the parent of all other elements:

XML文档必须包含一个根元素,该根元素是所有其他元素的父元素:

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

Above syntax shows the root element which is necessary while creating an XML code.

上面的语法显示了在创建XML代码时必需的根元素。

But the root element can be called anything. For example:

但是根元素可以称为任何东西。 例如:

<?xml version="1.0" encoding="UTF-8"?>
<note>
  <to>Tove</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
</note>

In the code above <note> is the root element.

在上面的代码中, <note>是根元素。

Advantages of using XML:

使用XML的优点:

  • Simplicity - XML documents are ordinary text files that can be created and edited with any text editor.

    简单性-XML文档是可以使用任何文本编辑器创建和编辑的普通文本文件。
  • Vendor independence

    供应商独立性
  • Platform independence

    平台独立性
  • Extensive infrastructure

    广泛的基础设施

Disadvantages of using XML:

使用XML的缺点:

  • Verbose and cumbersome syntax

    繁琐繁琐的语法
  • Highly inefficient storage

    效率极低的存储

翻译自: https://www.freecodecamp.org/news/an-introduction-to-extensible-markup-language-xml/

可扩展标记语言xml总结

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值