• Post Reply Bookmark Topic Watch Topic
  • New Topic

relative to absolute conversion  RSS feed

 
kent gibson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi-ya

I am looking for a library or even just a class that takes in an html doc, converts the relative links to absolute links and gives me back the html.

I can see how it would be done, but surely this must exist somewhere, no? Or do I have to roll my own?

thanks.

kent
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Firefox has plugins that yank every link on a page.

If you want to look at the page yourself, there is a link array that contains every link on the page.

Eric
 
kent gibson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, but I suppose I neglected to mention that I want to do this from a java application.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
then I will move this to a Java Forum....
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use the Quiotix HTML Parser which is a good tool to walk through the HTML, look for stuff, change it, and regenerate HTML.

If you use something like that you can find any relative addresses and fix them up. Here's code I use for that in my Wiki ... the "nameSpace" variable is the absolute path to the page that contains the relative links. It doesn't support "." to indicate current directory, but otherwise I'm pretty sure it works

[ April 07, 2005: Message edited by: Stan James ]
 
kent gibson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!