Introduction to XML

Among the five message body types supported in the JMS API, the TextMessage type was included on the presumption that String messages will be used extensively. The reason for this presumption is the increasing use of the Extensible Markup Language (XML) for inter-application communication.

What Is XML and Why Would You Use It?

XML is a structured text-based language consisting of tags that are used to describe a document's structure and meaning. It does not say anything about the visual representation of the document.

XML is non-proprietary. It is also easy for both computers and people to understand. Consequently, it is an extremely useful format for the interchange of data between different applications. By defining not only the content but also the structure of the data, XML is ideally suited to manipulating arbitrary data structures.

There are many good reasons for using XML, but one of the most significant is its ability to adapt to changes in the data. Because of this, senders and receivers do not need to agree on a common data format ahead of time.

The following is an example of XML:

<person>
    <name>
        <firstname>Winston</firstname>
        <surname>Churchill</surname>
    </name>
    <birth>
        <date month='November' day='30' year='1874'</date>
        <place>Bleinham Palace, England</place>
    </birth>
    <death>
        <date> month='January' day='24' year='1965'</date>
        <buried>Bladon, Oxfordshire, </buried>
    </death>
</person>

Even with no knowledge of XML, it is easy to work out what this example is describing; and herein lies much of the power of XML.

XML will be covered in more detail on Day 16, “ Integrating XML with J2EE” and an overview is provided in Appendix C, “An Overview of XML,” on the CD-ROM.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.246.245