Home > Articles > Web Services

  • Print
  • + Share This
This chapter is from the book

XML: Just Tags?

XML is simple. Technically, it's a language for creating other languages based on the insertion of tags to help describe data. However, XML is actually more than just tags. To see what we mean by this, let's begin with a simple XML data description.

XML is a combination of tags and content in which the tags add meaning to the content. The following is a simple XML markup of customer information. Start tags such as <Name> begin an element that contains the actual data. End tags such as </Name> mark the end of an element definition

<Customer>
    <Name>John von Neumann</Name>
    <PhoneNum>914.631.7722</PhoneNum>
    <FaxNum>914.631.7723</FaxNum>
    <E-Mail>Johnny@cd.com</E-Mail>
</Customer>

However, elements are only one way to describe data. It's also possible to represent the data using attributes within a single element:

<Customer name="John von Neumann" phone="914.631.7722" fax="914.631.7723" email="Johnny@cd.com"/>

In both these examples, the data is the same, but the form is different. There are several important basic points to observe about these definitions:

  • -XML allows data to be stored in either elements or attributes.

  • -Elements and attributes can be named to give the data meaning.

  • -Start tags and end tags define elements that are the basis for XML tree-structured representations of documents.

  • -Elements can contain text data and/or other elements.

While XML is more than just a few simple rules, its essential aspects can be grasped and understood quite easily. What's important about XML is what it brings to enterprise computing and how it is affecting many aspects of software development and e-commerce.

The XML Advantage

XML has had an impact across a broad range of areas. The following is a list of some of the factors that have influenced XML's adoption by a variety of organizations and individuals.

  • -XML files are human-readable. XML was designed as text so that, in the worst case, someone can always read it to figure out the content. Such is not the case with binary data formats.

  • -Widespread industry support exists for XML. Numerous tools and utilities are being provided with Web browsers, databases, and operating systems, making it easier and less expensive for small and medium-sized organizations to import and export data in XML format.

  • -Major relational databases now have the native capability to read and generate XML data.

  • -A large family of XML support technologies is available for the interpretation and transformation of XML data for Web page display and report generation.

XML: Design by Omission

In addition to XML's explicit advantages, it's important to realize that much of XML's widespread success and use derives more from what it does not address. There are three key design elements that by omission contribute to XML's success:

  1. -No display is assumed. Unlike HTML, XML makes no assumptions about how tags will be rendered in a browser or other display device. Auxiliary technologies such as style sheets add this capability.

  2. -There is no built-in data typing. DTDs and XML Schema provide support for defining the structure and data types associated with an XML document.

  3. -No transport is assumed. The XML specification makes no assumption about how XML is to be transported across the Internet. This has opened the door to creative ideas about delivering XML by means of HTTP, FTP, or Simple Mail Transfer Protocol (SMTP).

These design-by-omission principles can be reformulated by saying that XML explicitly limits the scope of ambitions to maximize interaction with other technologies.

  • + Share This
  • 🔖 Save To Your Account