Tuesday, August 18, 2009 at 7:54 PM.

howtoSuite.oldstuff.storeOpml

on storeOpml (username, opmltext, path) {
	<<Changes
		<<7/31/08; 3:44:15 PM by DW
			<<Created. 
			<<string.countfields ("hello/from/hollywood.opml", "/")
				<<3
	local (nomad = @howtoWebsite.[username], i);
	if not defined (nomad^) {
		new (tabletype, nomad)};
	bundle { //path cleanup
		if path beginswith "/" {
			path = string.delete (path, 1, 1)};
		if string.lower (path) endswith ".opml" {
			path = string.mid (path, 1, sizeof (path) - 5)}};
	for i = 1 to (string.countfields (path, "/") - 1) {
		nomad = @nomad^.[string.nthfield (path, "/", i)];
		if not defined (nomad^) {
			new (tabletype, nomad)}};
	local (adroutline = @nomad^.[string.lastfield (path, "/")]);
	op.xmltooutline (opmltext, adroutline);
	return (adroutline)};
bundle { //test code
	local (opmltext = op.outlinetoxml (@user.instantOutline.myOutline));
	storeOpml ("dave", opmltext, "/hello/from/hollywood.opml")}



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.