users
[Top] [All Lists]

Re: [cinjug-users] https login page: JDOM and XPath

To: <users@xxxxxxxxxx>
Subject: Re: [cinjug-users] https login page: JDOM and XPath
From: "Edward Sumerfield" <esumerfd@xxxxxxxxxxx>
Date: Wed, 21 Apr 2004 13:58:02 -0400
Delivered-to: mailing list users@cinjug.org
Mailing-list: contact users-help@cinjug.org; run by ezmlm
References: <28919746D11E5441A98ABF710A8ECEE50F9DBBB1@c092ex01.na.cintas.com>
Also, if you want it in a DOM you can let the dom do the loading from the input stream. xerces would require that you put your InputStream in an InputSource and then call the document.parse. It will then load and parse the xml right off the socket with no intermediate strings of files to clutter up your life.
----- Original Message -----
Sent: Wednesday, April 21, 2004 1:45 PM
Subject: RE: [cinjug-users] https login page: JDOM and XPath

Just a side note, depending on what you need from the XML file, you may want to consider using JDOM (http://jdom.org/) to read in the file from a String or InputStream and then use the XPath classes in JDOM (http://jdom.org/docs/apidocs/index.html) to get at the elements or attributes you need.  It requires very little code to do this.  XPath is very simple but powerful and can save you a lot of tedious parsing of XML.

 

There is a good tutorial on XPath if you need it: http://www.w3schools.com/xpath/default.asp

-Matt

-----Original Message-----
From: Jason Kretzer/STAR BASE Consulting Inc. [mailto:JKretzer@xxxxxxxxxxxxxxx]
Sent
: Wednesday, April 21, 2004 1:30 PM
To: users@xxxxxxxxxx
Subject: [cinjug-users] https login page

 


Hello all,

Thanks to everyone for their replies to my last question.  I did end up using the following code for it.

URL url = "" URL("https://someWebSite.com/giveXML.jsp?someparam=paramOne");

InputStreamReader isr = new InputStreamReader(url.openStream());
BufferedReader br = new BufferedReader(isr);


Then read the xml file one line at a time.




For my current question, I need to have my login.html page be https so that the POSTing of the form will not be sent plain text to the servlet.  I am using WebSphere 5 for this.  

Anyone give me a start on this?

Thanks,

-Jason

<Prev in Thread] Current Thread [Next in Thread>