Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Need to get the genuine xml data (not the html interpreted one)(Need for a means to get the genuine xml instead of the translated html)
Need to get the genuine xml data (not the html interpreted one) [message #779951] Mon, 16 January 2012 22:04 Go to next message
Robert Pastor is currently offline Robert PastorFriend
Messages: 2
Registered: January 2012
Junior Member
I am using an SWT browser to query a Livelink server (OpenText).
I assume that IE (Internet Explorer) is running behind the scene.
This OpenText server may answer with .xml when queried with an Object Action such as XmlExport.
The .xml data is translated by the web browser and using the getText method I get the translated html.
How can I obtain the original xml data as I could get in the browser if I would do mouse right click and then in the context menu, select view source code (of the web page).

any help would be greatly appreciated
Robert

[Updated on: Wed, 18 January 2012 12:42]

Report message to a moderator

Re: Need to get the genuine xml data (not the html interpreted one) [message #846637 is a reply to message #779951] Mon, 16 April 2012 12:46 Go to previous messageGo to next message
PASTOR Robert is currently offline PASTOR RobertFriend
Messages: 2
Registered: July 2009
Junior Member
In order to get the source XML file, I have "patched" the IE class - adding the following method :

public String getInnerXmlText() {
/* get the document object */
int[] rgdispid = auto.getIDsOfNames(new String[] {PROPERTY_DOCUMENT});
Variant pVarResult = auto.getProperty(rgdispid[0]);
if (pVarResult == null || pVarResult.getType() == COM.VT_EMPTY) {
System.err.println("swt IE: error while fetching the document: ");
if (pVarResult != null) pVarResult.dispose ();
return ""; //$NON-NLS-1$
}
//IHTMLDocument2
OleAutomation htmlDocument = pVarResult.getAutomation();
pVarResult.dispose();

rgdispid = htmlDocument.getIDsOfNames(new String[] { "body" });
pVarResult = htmlDocument.getProperty(rgdispid[0]);
if (pVarResult == null || pVarResult.getType() == COM.VT_EMPTY) {
if (pVarResult != null) pVarResult.dispose ();
return ""; //$NON-NLS-1$
}

// IHTMLElement
OleAutomation htmlElement = pVarResult.getAutomation();
rgdispid = htmlElement.getIDsOfNames(new String[] { "innerText" });
pVarResult = htmlElement.getProperty(rgdispid[0]);
if (pVarResult == null || pVarResult.getType() == COM.VT_EMPTY) {
if (pVarResult != null) pVarResult.dispose ();
return ""; //$NON-NLS-1$
}
String innerText = pVarResult.getString().trim();


return (innerText);

}
Re: Need to get the genuine xml data (not the html interpreted one) [message #854981 is a reply to message #846637] Tue, 24 April 2012 12:12 Go to previous messageGo to next message
Momoh OUKFIF is currently offline Momoh OUKFIFFriend
Messages: 3
Registered: April 2012
Junior Member
Hello,

I have the same problem, how can I resolve it without change IE class

Thanks
Re: Need to get the genuine xml data (not the html interpreted one) [message #867388 is a reply to message #854981] Tue, 01 May 2012 09:09 Go to previous message
Robert Pastor is currently offline Robert PastorFriend
Messages: 2
Registered: January 2012
Junior Member
I would suggest using the SWT examples OleWin32src.zip and extending the Ole Web Browser class.
Previous Topic:Higlighting letters of selected entry in a table?
Next Topic:Text widget in Mac Cocoa not recognising line break
Goto Forum:
  


Current Time: Fri Apr 26 03:57:05 GMT 2024

Powered by FUDForum. Page generated in 0.03100 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top