Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » XML and SWT Browser with IE
XML and SWT Browser with IE [message #855949] Wed, 25 April 2012 08:27 Go to next message
Momoh OUKFIF is currently offline Momoh OUKFIFFriend
Messages: 3
Registered: April 2012
Junior Member
Hello,

I use SWT Browser.setUrl(file.xml) method, by I can not get the contents of browser into a String using the method Browser.getText(). the result is :

<HTML><HEAD>
<STYLE>BODY{font:x-small 'Verdana';margin-right:1.5em}
.c{cursor:hand}
.b{color:red;font-family:'Courier New';font-weight:bold;text-decoration:none}
.e{margin-left:1em;text-indent:-1em;margin-right:1em}
.k{margin-left:1em;text-indent:-1em;margin-right:1em}
.t{color:#990000}
.xt{color:#990099}


Someone has an idea to get the contents well as the xml file into a string?
Note that I use Windows XP and IE
thanks!

[Updated on: Wed, 25 April 2012 09:39]

Report message to a moderator

Re: XML and SWT Browser [message #856375 is a reply to message #855949] Wed, 25 April 2012 15:55 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
The Browser doesn't provide API for this, you need to access the source
of the content directly. For an example of reading from a remote site
see http://snippets.dzone.com/posts/show/3553 . If it's a local file
then use a FileInputStream.

Grant


On 4/25/2012 4:27 AM, Momoh OUKFIF wrote:
> Hello,
>
> I use SWT Browser.setUrl(file.xml) method, by I can not get the contents
> of browser into a String using the method Browser.getText(). the result
> is :
>
>
> <HTML><HEAD>
> <STYLE>BODY{font:x-small 'Verdana';margin-right:1.5em}
> c{cursor:hand}
> b{color:red;font-family:'Courier
> New';font-weight:bold;text-decoration:none}
> e{margin-left:1em;text-indent:-1em;margin-right:1em}
> k{margin-left:1em;text-indent:-1em;margin-right:1em}
> t{color:#990000}
> xt{color:#990099}
>
>
> Someone has an idea to get the contents well as the xml file into a string?
> Note that I use Windows XP and IE
> thanks!
>
Re: XML and SWT Browser [message #857376 is a reply to message #856375] Thu, 26 April 2012 13:39 Go to previous message
Momoh OUKFIF is currently offline Momoh OUKFIFFriend
Messages: 3
Registered: April 2012
Junior Member
Thanks!
But, the XML file is the response of a web service REST. ( and i can't use httpclient get method to get the result) .
when I set manually the URL in IE Browser, the XML file displayed correctly!

When I use web-kit ( default browser) in Linux environment, I haven't this problem.

I thik that IE use XSLT to display xml files, but i don't know how disable it

[Updated on: Thu, 26 April 2012 13:46]

Report message to a moderator

Previous Topic:OS X: handle reopen event (user clicked dock icon)
Next Topic:Higlighting letters of selected entry in a table?
Goto Forum:
  


Current Time: Wed Sep 23 04:28:56 GMT 2020

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

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

Back to the top