How to Read XML Stream Using JSP
Posted on 2004-04-16
I am new to the JSP development world and have recently been asked to take on a project which I am not too familiar with.
What I need to do is this:
Grab/Call an xml stream via url (i.e. http://www.domain.com/xml/opentickets.xml)
This returns a valid XML document of the structure: (real example of output)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HDTickets [
<!ELEMENT Ticket (ticketID, title,status, owner, creationTime)>
<!ELEMENT ticketID (#PCDATA)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT status (#PCDATA)>
<!ELEMENT owner (#PCDATA)>
<!ELEMENT creationTime (#PCDATA)>
title ="EAP Not Working From outside."
status ="Pending - User Delay"
creationTime ="2003-06-25 10:29:31">
title ="Shared Mailbox Creation"
creationTime ="2004-04-14 08:26:58">
creationTime ="2004-04-14 16:28:16">
Using JSP, I would like to be able to read the values of each ticket(ticketid, title, status, owner, creationtime), assigne them to a variable, and then display them on the page as pure text
( out.println="Ticket ID= " & varTicketID )
I have no control over the format of the XML coming back, nor do I have ownership over the server to install any special software.
I figure there has to be a way that JSP can read this, asign data to variables, and then display....
The problem is, I really have no idea where to begin, and most sites I have been able to find discuss using specific parsers, installs, etc.
PLEASE HELP ME :)