9.3. Creating an XML Document with DOM

We've already generated both plain text and HTML output from our Standings application. Now, we'd like to generate XML as output. In order to do so, we must design our XML format. What will be the elements and attributes included in the document?

With our previous output formats, we were generating exactly what we wanted the user to see. With XML, the situation is somewhat different. Although it is possible to view the XML directly in a browser, we really expect the XML to be transformed to another form, such as HTML or WML (Wireless Markup Language), before the user sees it. In our earlier designs, we chose to show some fields and not show others. In the XML output, we want to include everything, and defer ...

Get J2EE™ and JAX™: Developing Web Applications and Web Services 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.