• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

relative to absolute conversion

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
then I will move this to a Java Forum....
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks!
 
reply
    Bookmark Topic Watch Topic
  • New Topic