It's a fact of life that XML, which stands for eXtensible Markup Language, is invading our lives more and more as programmers, and I feel this is a good thing. The reason being XML has the ability to cross all sorts of boundaries, and probably the only chance we have to obtain a truly independent, cross-platform data transfer format.
XML does not have a fixed number of tags or elements, as HTML does, but is extensible, as is SGML, allowing the document designer to define meaningful tags. XML represents a response to the inadequacy of both languages to meet typical information publishing needs in an era that includes global information networks, and conventional paper publishing. XML is designed as a slim SGML, better suited for software development, distribution on information networks, and for use on non-conventional computing systems. The virtue of XML will become clearer as the Internet expands and as information devices such as palm-held computers and cellular phones become increasingly popular. Now let us look at some terms, and different ways that XML can be laid.
Tag and Element: We have used the name <b>tag <b>to identify some HTML such as <b> and <h1>. An <b>Element<b> is a fully formed use of those tags. For example:
<b> Some Bold text and <I> italic text </I></b>.
This tag consists of two opening and closing tags and two elements: “b” and “I”. So an element comprises of a start tag, an end tag, and text it encloses, which can include other elements. This is of great significance because it introduces the concept of <b>Well-formed XML</b>. In which an openeing tag must have closing tags. This is very different from HTML where some tags like <IMG> and <BR> don’t have closing tags.
If you are using XML it is possible that some fields might contain no data. In that case the tags would be empty. Empty tags in XML could be define in one of the two ways. First is with start and end tags, but no content: <TagName></TagName>
The second way is to use an opening tag, but put slash at the end.
Another aspect of being well-formed is that XML tags are case sensitive, so opening and closin tags must match. This means the following is incorrect: