Next freebie in 28 Hours*
One of the main purposes of the development of XML was to enable inter-operability between information and the application that used or managed it. As an application is driven by logic, it is natural that the developer of the application expects data and information to be structured and organized as well. The fundamental unit of an XML document is, as discussed in previous sessions, an element. Any entity that is described as part of an XML document has to be organized as an element. An element can have other elements as part of its content. Content is thus versatile, not just character-encoded constant values such as numbers and alphanumeric strings. Even empty lines are legal content!
A few points need to be made at this point, and these will be followed by an appropriate example. The syntax of an XML document can be described as:
Now is an appropriate time to discuss a real-world example. Suppose a joint family of monkeys living on a banyan tree decide to set up a business, with several adult monkeys having different responsibilities:
In this snippet of legal XML, you can easily see how rules 1-4 are highlighted.
The element "monkey-business" is the top level root element of the "inverted-tree- visualization" of the XML document. The element category "monkey-role" is for labeling employee categories, and each element has several nested elements inside it (same as nested if All start tags are matched correctly with end tags, and we can see that the 2 elements of this category have different numbers and types of nested elements.
It is very logically organized. You can easily observe, if you have any programming experience, that programmed logic in an application can simply extract information from the organization of this document. That's the beauty of XML, and this convenience has led to its humongous presence on the web and in application software.
Have a question but don't want to ask it publicly? If you are a prime member just ask right here and we will get back to you within 48 hours. Not prime yet? no worries you can ask publicly below.