Handling XML Files Directly

We have built quite a few XML files in earlier chapters. However, one issue not touched on so far is how to properly handle direct access to an XML file.

The question to ponder is this: How should the XML files within a Web application be handled when the user directly requests them?

The first problem encountered is the browser. Figure 10.1 takes a quick look at the House.xml file created in Chapter 5, “Using DOM.”

Figure 10.1. Using Opera, Netscape, and Explorer to view XML.

The first thing to notice is that each browser will view the raw XML differently. The second fact to consider is that the browsers view the raw ...

Get JSP™ and XML Integrating XML and Web Services in Your JSP™ Application 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.