![]() |
|
|
|
|||
|
|
Using XML/XSL for Web
Publication
It seems XML is on its way to becoming the standard exchange format. At the same time, enterprises in all sectors are looking for a way to make the exchange of data and information easier, first of all within their own information systems - whether it be within operational systems (ERP, EAI), DataWarehousing, or knowledge management (Intranet, GroupWare) - and eventually with their partners' information systems (e-Procurement, syndication). In this article, we look at the problem of Web publication, a process which concerns all enterprises having to send and receive information. What makes XML the technical solution to content syndication? How can the XML/XSL couple facilitate multi-channel publication? We will illustrate this last point using an example near and dear to our hearts, the publication of TrendMarkers e-newsletter.
Web sites often rely on the principle of syndication in order to provide richer and more comprehensive information. What is syndication? On the other hand, syndication also works in the other direction. Indeed, syndicating content to subscribers can be a good source of revenue - direct if the content is sold to subscribers, or indirect if your intention is to make your name known to new internauts. TOP
How does XML make syndication easier? The use of XML does not require the implementation of a specific infrastructure; XML documents can be exchanged via Internet protocols (HTTP, HTTPS, FTP…). Document Type Definition (DTDs), and more recently XML Schemas, are used to define XML document structure. In fact, they are rules that define whether or not a document is valid, in other words whether or not a document respects a DTD model. If all partner sites agree to use a common document model, then each site can standardize its process of transforming received documents into personalized presentations (usually HTML). Even if the DTDs are different, they can easily be mapped using a simple XSL transformation as interface. How can an XML document source be exploited for Web publication? Based on tags, XML format is quite similar to the format supported by browsers. When combined with XSL, an XML file can easily be converted into HTML. How can XML be integrated in Web applications? As it is compliant with the Document Object Model (DOM), an XML document can be parsed in a Java program or in a scripting language. Moreover, most application servers already offer components that are capable of parsing input and creating XML output (COM XMLDOM component…). Finally, the structure of an XML document (text file in which tags identify the nature of the elements they surround) is ideal for search engines. In fact, there are already several specialized search engines available such as GoXML.com. TOP
Given the growing number of distribution channels that can be accessed by Internet, it is becoming more and more important to be able to manage content publication on several of these channels: Web sites, e-mail (in the form of a newsletter, for instance), WebTV or handheld devices (mobiles, PDAs). Within such a large scope, managing several versions of content in different formats can quickly become restricting. XML is a solution for storing a single content source that is independent of all presentation. Before an XML source can be sent to a given support, it must be transformed into a "presentable" document. Once again, it would be best to use a standard instead of a software-specific solution. As it is, the standard is eXstensible Stylesheet Language Transformation (XSLT). XSLT is itself a variant of the XML metalanguage (its elements and attributes are described using XML syntax). Version 1.0 has been an official recommendation of the W3C since November 16, 1999. It is part of the XSL specification, along with XSL-FO, which defines how objects are formatted (as CSS do). In this article, we are only going to look at XSLT, as this language describes how to transform an XML document into another XML document. Although it is the most common example, the transformation of XML into HTML is only one of the many XSLT possibilities. In order to carry out an XSL transformation, you must have an XSLT Processor. Many XSLT processors have already been implemented (mostly in Java); for example, Xalan, which is implemented by the Apache XML Project within the framework of an Open Source project. If you would prefer a packaged solution, XML and/or XSL editing tools such as Xml Spy, Stylus, and so on usually provide an integrated XSLT processor. With XSLT, you can write an XSL style sheet for each type of format you want to generate. However, output formats should respect XML syntax; this is especially true for WML, the tag-based language used for WAP browsers. Without going into the details of XSL programming, the following example shows the different options you have to optimize multi-channel distribution when using XML/XSLT. TOP TrendMarkers newsletter This example aims to show ways of facilitating the syndication of newsletter articles with partners and publishing TrendMarkers newsletter on new communication channels, for example, Web clipping for Palm VII. Articles are typed and made available in a valid XML format that respects a specific DTD. By using an XSLT processor and a collection of XSL style sheets, the application generates the following output formats:
What about WAP? Until this standard does appear, a viable solution is to write the content of your wireless applications in XML and apply the desired transformations with XSLT. The ideal situation would be to have the WAP portal (if it is a question of WAP) define the XML input format and take care of all conversions. TOP
In order to provide rich content, and to extend their visibility, more and more Web sites are making use of syndication. XML facilitates this process by providing an exchange format that is close to the Web and its standards, and can be formatted using a document model (DTD or XML Schema). XML use is not limited to content syndication, it is also a good solution in all the areas in which B2B applications are developed since such applications require the creation of a common part of partners' information systems. In addition, XML can be used as a content storage format. As the tags can surround metadata, it is sometimes possible to avoid relying on a DBMS. Moreover, XML is a perfect data storage solution before sending to wireless channels. Although there are currently no standards for mobile Internet, those that emerge will almost inevitably be XML-compatible. As a result, the XML + XSL solution is not only possible today (as we saw in the above example), but it should prevent you from wasting time on developments (pure WML, for example) that will quickly prove useless. TOP References:
TechMetrix Research is a technically
focused analyst firm focused on e-business application development needs.
Based in Boston, Mass., the firm publishes comparison reports and product
reviews designed to aid enterprises with decision making and to keep pace
with the fast-moving e-business market. TechMetrix is a U.S.-based subsidiary
of SQLI, a European company that offers on-site development services to
international organizations. SQLI specializes in e-business project
development. |
|