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


on createMessage (adrmsg, s = nil) {
	new (tableType, adrmsg);
	new (tableType, @adrmsg^.elementIDs);
	new (tableType, @adrmsg^.scopestack);
	local (adrdocument = @adrmsg^.doctree);
	if (s != nil) {
		xml.compile (s, adrdocument);
		bundle { //collect element IDs
			on collectIDs (adrtable, adrelement) {
				if defined (adrelement^.["/atts"].id) {
					adrtable^.[adrelement^.["/atts"].id] = adrelement};
				local (adrtemp = soap.xmlutils.getFirstChildElement (adrelement));
				while (adrtemp) {
					collectIDs (adrtable, adrtemp);
					adrtemp = soap.xmlutils.getNextSiblingElement (adrtemp)};
			collectIDs (@adrmsg^.elementIDs, adrdocument)}}
	else {
		new (tableType, adrdocument)};
	<<bundle //initialize pointers into doctree
		<<adrmsg^.envelope = false
		<<adrmsg^.header = false
		<<adrmsg^.body = false
		<<adrmsg^.fault = false
	return (adrdocument)}

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.