XML and Java for E-Business (4/4) - exploring XML
XML and Java for E-Business
XML in E-Business
The central idea of XML is the separation of content and presentation. No direct hints for how to render a certain set of data are included. Instead, markers in the text called tags classify the content of the text. A savings account number 4711 with a balance of $1 might look like this:
<account type="savings"> <number>4711</number> <balance>1.00</balance> </account>
How tags and data may be arranged within a document is defined by a Document Type Definition (DTD) or XML Schema (see column10). The parser can validate this document structure and thereby catch many errors early on. Furthermore the basic rules of XML documents are checked by the parser first, independent of DTD or Schema.
XSL-Transormations (XSL-T) are used to display or transform XML documents. On one hand XSL-T can transform tags in an XML document into HTML or WML (Wireless Markup Language) for output in a browser. Data can be collected once and then transformed in different ways for different purposes. On the other hand XSL-T can be used to convert from one DTD into another, a feature often used in E-Business environments, for instance for exchanging messages between two different Enterprise Resource Planning (ERP) systems. Rather than spending a lot of time on deciding on a common DTD, XSL-T can translate between different DTDs, assuming they contain the same information, just in different representations. This way the programs don't need to be changed. For details on XSLT see column17.
XML documents are saved in text files for processing and transport. Alas, most information in organizations is saved in relational databases. Most database vendors developed extensions to store XML documents in database tables. The mismatch between hierarchical XML documents and relational tables leads to suboptimal results for storage and retrieval of XML. Pure XML databases are at an advantage here, like Tamino from Software AG and dbXML from the dbXML group.
Most current XML parsers work with the SAX or DOM APIs as explained in column11. The Java API for XML Parsing (JAXP) links the two worlds of Java and XML by specifying the interface between Java application code and the XML parser. This way the application is decoupled from any specific parser, allowing to swap parsers without changing the application. JAXP supports XML 1.0, SAX 1.0, DOM Level 1 and XML namespaces.
Conclusion
Java and XML make a great combination for implementing distributed E-Business applications. XML enables disparate software systems to exchange messages. Java and J2EE have mechanisms for building distributed systems. Both application server software and XML tools are available free of charge. So upfront investments can hardly be an argument against starting a project with XML and Java.
Produced by Michael Claßen
All Rights Reserved. Legal Notices.
URL: https://www.webreference.com/xml/column27/4.html
Created: Jan 03, 2000
Revised: Jan 03, 2000