Originally posted by Peter Primrose:
how do I 'digest' it into xml?
My advice? Don't.
There's a complex API to digest XML and it's a pain in the keester. Sometimes you gotta deal with XML, but this isn't one of them.
Rather I'd recommend changing the
servlet to return JSON, or to return fully formatted HTML.
In fact, I'd recommend adopting a library such as jQuery that makes this sort of thing brainless. For example there's a method to fetch the data from the server in JSON format that automatically digests it for you and delivers the resulting JavaScript construct. This data can be used with DOM manipulation API to create the HTML elements.
The easiest route is to use a
JSP on the server to deliver the fully-formatted HTML and then to use JavaScript to instrument it with the appropriate event handlers to make it act like you want.
Are you just copying this code from somewhere? It seems like a bit of an advanced exercise for your knowledge level at this point.