Monday, November 08, 2010 at 12:05 AM.

on linkToStyleSheet (csspath, flUseImportCommand=false) {
		<<9/15/04; 12:14:24 AM by LL
			<<Created. Generates a link to the CSS file defined.
	local (pta = html.getpagetableaddress ());
	local (flFileUrl = pta^.radioResponder.flSameMachine);
	if csspath beginswith "/" {
		csspath = string.delete (csspath, 1, 1)};
	local (f = + string.replaceall (csspath, "/", file.getpathchar ()));
	bundle { //correct the case -- the static server is case-sensitive
		local (pc = file.getPathChar ());
		if system.environment.isMac { //MacOS -- convert to a filespec to fix the filename's character-case
			f = string (filespec (f))}
		else { //workaround for windows: use fileloop (f in f) {} to fix the filename's character-case
			fileloop (f in f) {}};
		csspath = string.replaceAll (string.delete (f, 1, sizeOf (, pc, "/")};
	local (url);
	if flFileUrl {
		url = html.getfileurl (f)}
	else {
		url = radio.upstream.getFileUrl (f)};
	local (linktext);
	if flUseImportCommand { //Netscape 4 can't see the style sheet in this case
		linktext = "<style type=\"text/css\">\r@import url(\"" + url + "\");\r</style>"}
	else {
		linktext = "<link rel=\"stylesheet\" type=\"text/css\" href=\"" + url + "\"></link>"};
	return (linktext)}

This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.