Re: Finding and modifying links

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
http://www.w3.org/People/Frystyk

Received on Wednesday, 3 March 1999 17:03:10 UTC