Applied XML Solutions
Authors: Marchal B.
Published year: 1999
Pages: 42-44/142
Buy this book on amazon.com >>
   

Building and Running the Project

The publish project is available on the enclosed CD-ROM. Copy the project directory from the CD-ROM to your hard disk. Under Windows, start the server by double-clicking publish.bat . Next, open a browser and type the following URL (refer to Figure 4.7):

http://localhost:8080/publish

If possible, you should download at least one WAP browser and test the document again. You also might want to register the RSS channel with a portal.

Warning

This project uses Xalan 1.0 as the XSLT processor. If you are using another processor, you will need to adapt style() .

The project also uses Jetty as the Web server. However, because it is based on servlets, it should be easy to adapt to another Web server. You can add servlet support to most Web servers through JRun.


If you develop your own documents, register the corresponding RSS channels with http://www.xmltree.com, http://my.netscape.com, and http://my.userland.com.

   
   

Additional Resources

If you find this project useful, be sure you read Chapter 8 as well. Chapter 8 presents a different twist on the same technique and many useful extensions to the servlet.

DocBook

As has already been indicated, for more complex documents, you can turn to the DocBook DTD available from http://www.docbook.org. DocBook is a powerful DTD for document publishing and is available in both SGML and XML.

XHTML

WML is the most popular markup language for mobile users, but the W3C is working on its own solution. The W3C has developed XHTML, an XML version of HTML. The recommendation is available from http://www.w3.org/TR/xhtml1.

The major advantage of XHTML is that it is based on HTML so it will be familiar for Web designers. The major inconvenience of XHTML is also that it is based on HTML. This results in a large and complex markup language. Therefore, XHTML currently is too complex for mobile phones.

The W3C is working to simplify XHTML. Only time will tell whether XHTML will achieve widespread acceptance.

Open eBook

Another interesting format for mobile users is the Open eBook specification. Open eBook was designed for eBook, a different group of mobile users. An eBook can take many forms, but it is generally a palm- sized device on which readers download books.

You will find more information on Open eBook from the Open eBook Forum at http://www.openebook.org. A popular eBook reader is the Rocket eBook, available from http://www.rocketebook.com. Unfortunately, it does not support the Open eBook format yet.

ICE

I introduced RSS as the content syndication format in this chapter because RSS is very popular. RSS is not the only choice, however.

An alternative is ICE (Information Content and Exchange protocol). ICE is a more ambitious project that aims to link content providers and publishers. You can find more information on ICE at http://www.w3.org/TR/NOTE-ice.

   
   

Chapter 5. Export to Any Format

In this chapter and the next , we'll have more fun with XSLT. In the previous chapter, we were syndicating content in a variety of formats. This led us to explore transformations and the XML tool for transformation: XSLT.

Although powerful and effective, the transformations in the last chapter remained in the family because we essentially converted documents from one DTD to another DTD. Although both formats were different, they were based on XML. Yes, we also converted to HTML but, again, XML and HTML are very similar. In this chapter and the next, we'll open the door to more alien formats. Although an explosion in the number of XML-based formats has occurred, many non “XML-based formats are still out there. Some examples include the following:

  • When you publish documents, you might want to convert them to RTF, which is recognized by Word, or PDF, which is Adobe Acrobat's format.

  • If you are active in graphics and design, you probably don't want to throw away existing Adobe Illustrator, CorelDRAW, or CGM files.

  • In electronic commerce, as we will see, legacy formats such as ANSI X12 and UN/EDIFACT need to be supported.

This chapter concentrates on transformation from XML documents to documents in non-XML format; in other words, exporting XML-based documents to other applications. The next chapter is concerned with the reverse operation and discusses how to import non-XML documents in XML applications.

These two chapters build around the same project that is related to e-commerce and, more specifically , with converting EDIFACT documents to and from XML. The two reasons I chose EDIFACT as the typical non “XML-based format are as follows :

  • I'm very familiar with EDIFACT and e-commerce.

  • EDIFACT gives me a chance to demonstrate both sides of the problem. It is common for an e-commerce application to convert to and from EDIFACT, which is not the case with, say, PDF.

However, the techniques introduced in these two chapters are not limited to EDIFACT. As discussed previously, they are commonly used for PDF, RTF publishing. In e-commerce, you might also consider other legacy formats such as X12. Essentially, you need to build such a solution each time an XML application interfaces with a non-XML application.

   
Applied XML Solutions
Authors: Marchal B.
Published year: 1999
Pages: 42-44/142
Buy this book on amazon.com >>