This article is aimed at developers who are good at programming languages like Java and want a quick jump on the XSD bandwagon by understanding some important concepts like namespaces. Hope that this article helps to make you understand namespaces quite easily.
What is a namespace?
A namespace is an identifier for elements. XML and XSD use the concept of namespaces to define a relationship between the elements and their hierarchy. It means that when their are multiple elements to be defined then it might be possible that some of the elements may tend to have the same name. But having the same name often leads to collision just as the in the case of classes with same names although in different packages but referenced by name alone in a Java program. Hence the concept of namespaces is used in order to distinguish such elements.
Why are namespaces used?
XML and XSD are never meant for human reading. You have to remember that even though XML is a data representation markup language, it would be rare that you will actually be parsing through an XML file to use the data in your application through your own code.
Such parsing is often supplied through the use of API’s like SAX, DOM, JAXB, etc. You would have till now actually used these libraries while dealing with web services since it is field which uses XML, XSD to the maximum. The concept of namespace has no relevance until and unless an XML instance is associated with an XML Schema (XSD). This is because, XSD defines what do the elements in the XML instance actually mean. A standalone XML just makes the data easier to understand to you but to an XML parser it is nothing but a set of elements in some heirarchy.
For example if suppose you have the following XML format: Read the rest of this entry »
Apache Ant is a powerful way to convert your developmental structures to deployment structures. It is declarative and all the command line tasks used for deploying an application are represented by simple XML elements. Without much details, this tutorial would breeze you through the steps on how to build a web application using a single XML build file and nothing else. If you have not yet understood what is the use of Ant, read my article on Development and Deployment Structures – the perfect way to build web applications.
I would use the same analogy of my development structure as mentioned in the above linked article i.e. my development structure consists of the following directories:
Read the rest of this entry »
The purpose of annotations have been well put forward with the recent upgradation of EJB to EJB 3.0 and also in the web services field by JAX-WS. Annotations help in reducing the learning curve associated with these specifications by avoiding the need to learn the deployment descriptors which are necessary to properly deploy an EJB or a JAX-WS web service respectively.
Annotations – a boon or a curse?
Due to the above situation, the influence on the usage of annotations is steadily rising. It is but natural that programmers would try to do their work quickly without having to waste the time in learning the XML Schema’s required for deployment. Annotations are purposely aimed at this programmer’s dilemma. In fact when I was working in JAX RPC, I used to think as to when I would get a tool to code those ugly descriptors in an easier fashion. With annotation based web services creation in JAX-WS, half of my work is done when I put them in the POJO itself.
All of this can be attributed as a boon to the presence of annotations. But the point of worry is, Read the rest of this entry »
XML is document-oriented and JSON is data-oriented. So if you want to deal with highly structured documents that requires a complex structure, binary data, exact ordering of elements and be able to render itself then use XML. If you are focused on light-weight data exchange then JSON is the way to go.
In my opinion too JSON is handy only for light weight data transfer and nothing more than that. But with more nesting of data JSON can get utterly complex than XML. With XML you can define Schemas, form standardized document structures , extend exisiting document structures or import them when needed. The namespaces concept of XML has been very well established and incorporated in today’s applications and libraries.
Read the rest of this entry »
Working on the BEA Aqualogic Data Services Platform 2.5 (AL-DSP) over the BEA Weblogic 8.1 has widened my imagination of web technology to even more higher levels. It has given me a confidence that I can now say the future of the newly emerging technologies is simply unimaginable. In the earlier few months of this year I was working on JAXB which was a one of a kind object oriented XML parser provided in the JWSDP 2.0 J2EE web services packages by Sun Microsystems. It made me aware how to go about working with XML, XSD and some amount of XPATH.
BEA AL-DSP 2.5 takes it more further ahead by leaps and bounds utilising all the power of XML communication and combines the usage of XML, XSD, XPATH and XQUERY to give a complete package which can be used as a whole new kind of abstraction layer which can amalgamate data from different kind of data sources. The data sources which can be used to collect data in DSP is currently from JDBC sources, Web services, JAVA functions, XML data and Delimited (CSV) formatted data.
A layer of DSP site above the underlying different physical sources and all the developer needs to do is Read the rest of this entry »