Home » Internet » Web Design

What is XML Schema?

Aug 26, 2007
It used to take me 10 minutes to design a web site. When I began designing web sites back in 1996, the process was very simple. I would ask the person who had requested the web site to put all of their content into a Microsoft Word file and email it to me. I would copy and paste that content into FrontPage or a text editor, insert some HTML tags to create the layout, add some graphics for style and I was finished.

Wireless technology put the kibosh on my plan to make a decent living working 30 minutes per day for the rest of my life. Beginning in 1998 or 1999, every wireless electronic gadget under the sun now came equipped with full access to the internet and email. Web browsers and email client software were installed on laptops, palm tops, cell phones, and computer screens in automobiles, to name a few.

The platforms and web browsers being used on wireless products are different from an ordinary desktop PC. These new systems are not fully compatible with many elements of the HTML programming language. As a result, websites created exclusively with HTML are often invisible or inaccessible to the wireless user.

The programming community responded by creating cross-platform compatible languages and specifications for creating web sites so that all sites could be viewed equally, or at least close to equally, on all web browsers. A language called XML was created to define data without telling the browser how to display it. HTML forced the browser to display data a certain way. XML defined data without telling the browser how to display it because XML was a simple text file. Thus, data created with XML could be viewed on any machine, computer, or browser. Then, specifications such as XHTML and XSL were developed in order to turn XML files into web pages that had style and structure, and more importantly, could be viewed and interpreted across all platforms, wireless or not.

Now that you understand how and why web design has changed, you are ready to learn about the main topic of this article, XML Schema. XML Schema is a specification that enables a programmer to describe the structure of an XML document. Programmers used to rely on Document Type Definition (DTD) to structure their XML documents, but XML Schema is now seen as the permanent replacement for DTD.

XML Schema was initially introduced by Microsoft, and was later endorsed and adopted by the World Wide Web Consortium (W3). XML Schemas ensure that data can be communicated in a format that is universal. For example, different countries use different formats to display the date. Some countries put the month first, others put the day first, and some put the year first. The XML Schema for date requires that all dates be in YYYY-MM-DD format. Thus, everyone viewing XML data knows what the data is because they know it is written in XML Schema.

XML Schema has a lot of built-in data types for defining data. To define data, XML Schema uses attributes. XML Schema attributes are somewhat similar to HTML attributes in that they are included within a tag, and the attribute further defines the tag. With HTML, an image tag would have a source attribute to provide the name of the file that contains the image to be displayed. Another example of an HTML attribute would be an alignment attribute within a paragraph tag that stipulates whether the paragraph should be aligned to the left or right. Examples of XML Schema attributes for describing data are string, decimal, boolean, integer, date, and time.

One of the most important features of XML Schema is that it is replete with many different built-in restrictions that can be imposed on all data so that data is consistently displayed a certain way or presented in a certain format. Using XML Schema restrictions, a programmer can impose limits on upper or lower bounds for ranges of numbers, the length of numbers or the length of lists of items, and XML Schemas can even be used to define how white space is handled (tabs, line feeds, etc.).

XML Schema and XML programming are not easy to learn. You might want to start by searching for some basic online tutorials, but if web design is your full-time profession, you should instead enroll in some courses offline at a local college or computer programming institute. If you do not make use of versatile languages such as XML, XSL, and XHTML, your website might be invisible to those who surf the web on wireless devices, and you might be putting your career as a web designer in jeopardy.
About the Author
Jim Pretin is the owner of http://www.forms4free.com, a service that helps programmers make email forms.
Please Rate:
(Average: Not rated)
Views: 193
Print Email Share
Article Categories