XML and Semantics
In this post on What is XML? Jim Baldo asks a very interesting and important question. What does anyone mean by XML?
A number of people still say that they use XML because it is self-describing. No way. XML is not self-describing. I have seen people asking questions in the line of “Here is the schema. Don’t you understand what this XML means?”. No. XML and schemas don’t make data self-describing either. Schemas and DTDs don’t add semantics to XML. They add constraints to XML documents.
So, where do semantics come from? Definitely not from XML or a schema. We need something else, like a specification, or a document that someone wrote, that describes what a given XML element/attribute means in a given context. Neither the context nor the meaning can be described with in an instance document or a schema, because, the same piece of XML can mean different things to different people (read applications). So, mere presence of a schema describing XML does not tell an application what to do with it.
Jim’s post reminds me of a long thread of posts on the service-oriented-architecture group. The thread started with a question - Is the WS-vision achiavable?. The thread went on to discuss “self-describing” services, i.e. services that can be discovered dynamically and used by dynamically generating/constructing the client. The trouble with this approach is that, once you discover an arbitrary service, you need to know the semantics before you can use the service correctly. The mere fact that a service uses a WSDL and an XSD does not mean that it is self-describing.
The only time when dynamic binding of services can work is when the semantics are understood (e.g. in a vertical domain) by all parties (service providers and consumers). Even in that case, we can’t say that such services are self-describing.



No comments yet.