It puts the X in Ajax: How to structure XML for interactive Web apps
This article is excerpted from Ajax for Web Application Developers, copyright 2007, published last month by Sams Publishing. Reprinted with permission, all rights reserved.
XML (Extensible Markup Language) is a popular choice for Ajax, simply because it is the standard intermediate language that all programming languages are able to share. It is also supported both on the server side and client side, which makes it the most flexible solution. XML is essentially a custom tag-based structure that you, the developer, define. XML's tag-based structure is similar to that of HTML, except that HTML has predefined tags that represent its structure, such as the head, the body, tables and so on. The following is an extremely simple example of an HTML table, which could easily be translated or used as XHTML:
<p><table><tr><td></td></tr></table></p>
XML can be passed between the front end and the back end for easy communication of multiple languages. Having this common language between the front end and the back end is extremely powerful. It enables us to create direct connections from the GUI to a server-side language and, ultimately, if desired, a database. Communicating with XML between the GUI and the front end allows for complete separation of the two application layers. Separation of the GUI and the back-end logic is extremely important because it enables us to have a completely decoupled application in which GUI developers can work on the front end, while the back-end developers work on the back end.
This might seem like common sense, but it is an approach lacking in many companies. It keeps specific parts of the application separated for easier management, and allows teams or individual developers to focus on the layer that is in need of growth. Not only is this approach ideal for teams of developers, it is also important for any individual developer who might be working on every part of the application. With this structure, an individual developer can focus on specific layers of the application without interfering or having to make changes to the adjacent layers.
XML formatting is trivial, but there are important principles to consider when planning a solution. Imagine having to format e-mail data into a structure that could be requested through an Ajax engine and displayed with client-side JavaScript objects. When architecting this structure, we want to keep in mind that we may use it in multiple objects or locations of the application and should therefore keep it as abstract as possible. We will start by defining the main elements that will create this structure.
Elements
XML is composed of custom tags called elements, which are defined in the architecture phase of a Web application. They can represent any name, value or data type that will be used in your application. When creating an XML structure, you become the architect of your application, deciding what data you will need to display certain items on the screen, or what response should happen based on a user's interaction.
XML
Additional Resources



White Papers & Webcasts
Extend, Replace, or Convert; which is the best way forward for COBOL Applications?
Download this white paper, free, compliments of Micro Focus!
Data in Action: Making the Planet Smarter
Register Now
Oracle Accelerate - Not Just Smart but Timely
Download Now!
Why BI is Ripe - Now! - For Businesses of Any Size
Download Now!
The Workday User Experience Video
Watch Workday's Creative Director, Scott Lietzke, discuss the business-centered design philosophy at Workday.
Business Process Framework Demo
Learn about Configurable Business Processes and Calculated Fields. Watch Now!
Rapid Implementation: The New Age of ERP
Download Now!
Manager Experience Demo
Go beyond self-service solutions to perform more effectively. Watch Now.

