What Is the Difference Between a Tag and an Element?

情到浓时终转凉″ 提交于 2019-12-18 01:33:28

问题


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?


回答1:


Tags mark the start and end of an element.

  • <foo> — start tag
  • </foo> — end tag
  • <foo></foo> — element

See the specification:

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.


See also section 5 of NOT the comp.text.sgml FAQ



来源:https://stackoverflow.com/questions/12027770/what-is-the-difference-between-a-tag-and-an-element

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!