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. 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.
Definition and Usage. The <a> tag defines a hyperlink, which is used to link from one page to another. The most important attribute of the <a> element is the href attribute, which indicates the link's destination. By default, links will appear as follows in all browsers: An unvisited link is underlined and blue.
Tags mark the start and end of an element.
<foo>
— start tag</foo>
— end tag<foo></foo>
— elementSee 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
<address category = "residence"> <name>name content</name> <company>company content</company> <phone>(011) 123-4567</phone> </address>
Here <address>
is an element which has attribute category
Start and end tags
of an element
must be identical.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With