标签和元素有什么区别? [英] What Is the Difference Between a Tag and an Element?

查看:33
本文介绍了标签和元素有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一些关于 XML 的文本中,术语 tagelement 似乎可以互换使用.它们是同一个意思,还是这些术语代表不同的东西?

In some texts about XML, the terms tag and element seem to be used interchangeably. Do they mean the same thing, or are do these terms represent different things?

推荐答案

标签标记元素的开始和结束.

Tags mark the start and end of an element.

  • — 开始标签
  • </foo> — 结束标记
  • — 元素
  • <foo> — start tag
  • </foo> — end tag
  • <foo></foo> — element

请参阅规范:

每个 XML 文档包含一个或多个元素,其边界由开始标签和结束标签分隔,或者对于空元素,由空元素标签分隔.

Each XML document contains one or more elements, the boundaries of which are either delimited by start-tags and end-tags, or, for empty elements, by an empty-element tag.

<小时>

另请参阅非 comp.text.sgml 常见问题解答的第 5 部分

这篇关于标签和元素有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆