W3C home > Mailing lists > Public > www-lib@w3.org > January to March 1999

Re: Finding and modifying links

From: Henrik Frystyk Nielsen <frystyk@w3.org>
Date: Wed, 03 Mar 1999 17:02:31 -0500
To: www-lib@w3.org
Message-ID: <36DDB177.476E0F64@w3.org>
To: Raffaele Sena <raff@nuvomedia.com>

Raffaele Sena wrote:

> I also have callbacks set for tags and text, so that I dump the new page
> content to an output file.
> I still have the problem that I would like to assign the right extensions
> to file names, but in the findLink callback of course I don'k know about
> the mime type of the file
> I will be downloading ): Any idea on how I could do this without recursively
> start a new request every time I find a link ?

Hmm, maybe the HTSaveLocally stream would of use [0]. It finds the name
of the file to save in after the head has been received and can hence
use the anchor information to come up with a useful name.

If you want to parse and save as the same time then you could use the
Tee stream [1] like this

			       /-->  SGML/HTML/HText parsers
	--> feed --> T stream <
			       \-->  HTSaveLocally

That is, instead of registering the SGML and HTML parsers directly you
register a Tee stream which creates the two substreams.

[0] http://www.w3.org/Library/src/HTFSave.html
[1] http://www.w3.org/Library/src/HTTee.html

Henrik Frystyk Nielsen,
World Wide Web Consortium
Received on Wednesday, 3 March 1999 17:03:10 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:33:49 UTC