13.6. Programming with XML

To illustrate how a Web application can generate, parse, and manipulate XML data, a servlet, the CDOXMLServlet, was developed for the CD Organizer example. The complete source code is included on the CD-ROM provided with this book. The CDOXMLServlet generates and returns XML data in various ways depending on the value of the catalog type (cattype) parameter in the HTTP request. The general coding of the servlet will not be discussed. Only the code specific to XML will be discussed.

The CDOXMLServlet builds the CD catalog and then based on the value of the HTTP request parameter cattype (catalog type) calls a method to return the catalog in some XML-related form. The following sections discuss the processing preformed ...

Get WebSphere V3.5 Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.