What Is the Difference Between a Tag and an Element?

后端 未结 1 1637
离开以前
离开以前 2020-12-15 04:15

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

相关标签:
1条回答
  • 2020-12-15 04:39

    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

    0 讨论(0)
提交回复
热议问题