function domController(element, rootId) {
		remover = new RegExp("^" + rootId + "-");
		if (element.children("fieldset").length > 0) {
			/** DOM elements with fieldsets are objects or arrays **/
			// Get the sub UL element
			element = element.children("fieldset").children("ul");
			
			// Read the path from the UL's id
			path = element.attr("id").replace(remover, "").replace(/-/g, ".");
			
			// Write the appropriate object to the outputResource
			if (element.hasClass("array")) { outputResource.setProperty(path, []); }
			else if (element.hasClass("object")) { outputResource.setProperty(path, {}); }
			
			// Iterate through this element's children
			element.children().each(function(index, ele) { domController($(this), rootId); });
		} else {
			/** DOM elements without fieldsets are property/value pairs **/
			// Read the path from the UL's id
			path = element.attr("id").replace(remover, "").replace(/-/g, ".");
			
			// Get the property's value
			if (element.children("input[type=checkbox]").length > 0) { value = element.children("input[type=checkbox]").is(":checked"); }
			else { value = element.children("input, textarea, select").val(); }
			
			// Write the property/value pair to the outputResource
			outputResource.setProperty(path, value);
		}
	}
// Iterative function that writes content to the output resource by reading the HTML DOM
Iterative function that writes content to the output resource by reading the HTML DOM
Iterative function that writes content to the output resource by reading the HTML DOM
function domController(element, rootId) {
		remover = new RegExp("^" + rootId + "-");
		if (element.children("fieldset").length > 0) {
			element = element.children("fieldset").children("ul");
			path = element.attr("id").replace(remover, "").replace(/-/g, ".");
			if (element.hasClass("array")) { outputResource.setProperty(path, []); }
			else if (element.hasClass("object")) { outputResource.setProperty(path, {}); }
			element.children().each(function(index, ele) { domController($(this), rootId); });
		} else {
			path = element.attr("id").replace(remover, "").replace(/-/g, ".");
			if (element.children("input[type=checkbox]").length > 0) { value = element.children("input[type=checkbox]").is(":checked"); }
			else { value = element.children("input, textarea, select").val(); }
			outputResource.setProperty(path, value);
		}
	}
function domController ( element , rootId ) { remover = new RegExp ( "^" + rootId + "-" ) ; if ( element . children ( "fieldset" ) . length > 0 ) { element = element . children ( "fieldset" ) . children ( "ul" ) ; path = element . attr ( "id" ) . replace ( remover , "" ) . replace ( / - / g , "." ) ; if ( element . hasClass ( "array" ) ) { outputResource . setProperty ( path , [ ] ) ; } else if ( element . hasClass ( "object" ) ) { outputResource . setProperty ( path , { } ) ; } element . children ( ) . each ( function ( index , ele ) { domController ( $ ( this ) , rootId ) ; } ) ; } else { path = element . attr ( "id" ) . replace ( remover , "" ) . replace ( / - / g , "." ) ; if ( element . children ( "input[type=checkbox]" ) . length > 0 ) { value = element . children ( "input[type=checkbox]" ) . is ( ":checked" ) ; } else { value = element . children ( "input, textarea, select" ) . val ( ) ; } outputResource . setProperty ( path , value ) ; } }
Iterative function that writes content to the output resource by reading the HTML DOM
Iterative function that writes content to the output resource by reading the HTML DOM
/** DOM elements with fieldsets are objects or arrays **/ // Get the sub UL element // Read the path from the UL's id // Write the appropriate object to the outputResource // Iterate through this element's children /** DOM elements without fieldsets are property/value pairs **/ // Read the path from the UL's id // Get the property's value // Write the property/value pair to the outputResource