XML: Leading the March to Web Services (cont.)

Step 2: The Need for Data Types and Schema
Until recently, relational databases had one huge advantage over XML, which is that they store strongly typed data. If you look at the sample XML document shown above, you'll see that it consists of text items, numeric items, and date items, all stored as quoted strings. When you retrieve an item from a database, you almost always know its data type.

Schemas are like a contract, because they both codify the format of documents that systems on either end of a transaction can use and guarantee that the documents themselves adhere to a specific format and content.
From its progenitor, the Standard Generalized Markup Language (SGML), XML inherited the concept of creating an associated document that defines the rules for tags in other documents, called a Document Type Definition, or DTD. The concept was powerful, but DTDs were difficult to parse (because they weren't XML documents) and had some other weaknesses. A W3C-recommended replacement technology, called XML Schema, maintained the DTD concept that one document can define the content of other documents but changed the defining document's format to XML. With XML Schema, a standard parser could read both the defining document, or schema, and the data document itself.

XML Schema documents define a common set of data type names, such as string, integer, and date, so you can create a schema to accompany your XML document that defines the data types that each tag or attribute can hold. By reading the schema first, parsers can then cast data values to the correct types as they read the data in associated documents.

W3C-recommended replacement technology, called XML Schema, maintained the DTD concept that one document can define the content of other documents but changed the defining document's format to XML. With XML Schema, a standard parser could read both the defining document, or schema, and the data document itself.
In addition, schema documents define boundaries for the order and arrangement of tags within conforming XML documents, the range or set of valid values for attributes, and the minimum/maximum occurrence of tags and attributes. Parsers that can read XML schema and compare the content of XML documents with a schema are called "validating" parsers; an XML document that conforms to the rules of its schema is called a "valid" document.

In other words, after you have the schema for an XML document you can ensure not only that the document is well-formed, but also that it is valid. That's extremely important, because it means that programs using validating XML parsers can pinpoint bad data in XML documents—without the program knowing anything specific about the document in advance. Validation capabilities can reduce or sometimes even eliminate the need to write custom validation code.

Schemas were the second step in the evolution of Web services. Schemas are like a contract, because they both codify the format of documents that systems on either end of a transaction can use, and guarantee that the documents themselves adhere to a specific format and content. Perhaps most important, schemas provide a way for machines to perform codification and validation processes generically and without human intervention.


Introduction Achieve Firewall Transparency

In this Article
Introduction Step 3: Achieving Firewall Transparency
Step 2: The Need for Data Types and Schema The Final Step: Invoking Remote Components Using SOAP
 





FEATURE SOFTWARE:
dtSearch Web
Add power searching to your web site.
Buy Now!

Encrypt It
Encrypt and Decrypt Data, Passwords and Files within your application.
Buy Now!

Standards Organizations and Web Service Coalitions

Key Platforms

Pure-Play Web Services Vendors

Web Service Technologies or Components

From Sun.com

For Further Reading

Discussion Groups
Java Web Services
.NET Web Services

Back to the Special Report

Java Zone

2001 Special Report: Judging Java

TALK BACK
Do you agree that the current focus on Web services is merely a short-term phenomenon, and that Web services will eventually become part of the standard network "plumbing" that everyone uses but few people really need to understand? Talk about it in the Java Web Services discussion group.


Sponsored Links

Advertising Info  |   Member Services  |   Contact Us  |   Help  |   Feedback  |   Site Map
Jupiterweb networks

internet.comearthweb.comDevx.comClickZ

Search Jupiterweb:

Jupitermedia Corporation has four divisions:
JupiterWeb, JupiterResearch, JupiterEvents, and JupiterImages

Copyright 2004 Jupitermedia Corporation All Rights Reserved.
Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Jupitermedia Corporate Info | Newsletters | Tech Jobs | E-mail Offers

Copyright Information/Privacy Statement