W3C home > Mailing lists > Public > www-lib@w3.org > July to September 1999

Re: How to expand a relative URL into an absolute one ?

From: Evguenii SMOGAILOV <evguenii@ess.co.at>
Date: Mon, 23 Aug 1999 12:22:29 +0200 (MET DST)
To: Michael Maretzke <michael.maretzke@gmx.de>
cc: Libwww <www-lib@w3.org>
Message-ID: <Pine.SOL.3.96.990823121905.24903A-100000@mp1>
On Mon, 23 Aug 1999, Michael Maretzke wrote:
> I parse a "<a href="./foo.html"> ... </a>" using the callback-functions.
> This file is located on a server called "http://www.foo.com" and is stored
> in
> directory "/test/test2/". "/" is here the WWW-root-directory.
> 
> Extracting the parameter file "./foo.html" is no problem. But now I've
> to expand this relative URL "./foo.html" into an absolute one
> "http://www.foo.com/test/test2/foo.html". How may I do this ?
> Which one of these libwww-servicefunctions is the right one for me ?

I'm currently using 'HTAnchor_followMainLink' and 'HTAnchor_address'
(from a sample program findlinks).
maybe it would help...

void foundLink (HText * text, int element_number, int attribute_number,
	HTChildAnchor * anchor,	const BOOL * present, const char ** value)
{
    if (anchor) {
	HTAnchor * dest = HTAnchor_followMainLink((HTAnchor *) anchor);
	char * address = HTAnchor_address(dest);
...

Evguenii
Received on Monday, 23 August 1999 06:22:45 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:15:17 UTC