aspose file tools
The moose likes Java in General and the fly likes Reading HTML Special characters Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Reading HTML Special characters" Watch "Reading HTML Special characters" New topic
Author

Reading HTML Special characters

Maha Hassan
Ranch Hand

Joined: Aug 02, 2005
Posts: 133
Hi,

I am reading an HTML document, extracting some text from it and then I write them to a file.

I have a trouble with HTML entities like"&nbps;" is there a way to make them printed as a normal space.

Thanks

Maha
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
See Apache StringEscapeUtils that encodes and decodes HTML among other things. Does that do the trick?

If your string extraction is very tricky you might do well to use an HTML parser. I like the Quiotix Parser myself.
[ September 05, 2006: Message edited by: Stan James ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Maha Hassan
Ranch Hand

Joined: Aug 02, 2005
Posts: 133
Hi,

This is a silly question, but how to use this package ??

thanks

Maha
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Reading HTML Special characters
 
Similar Threads
Confusion between domain model and presentation model
Difference between LinkedList and ArrayList
Reading List
What exactly happens in a call to Object.wait()
Uploading from a web page