Sets an element’s contents
Contents could be: One or multiple (as an array) of the following:
- An object literal that will be passed through Utopia.element.create
- A string or number, which will become a text node
- An existing DOM element
546027
function (element, contents, where) {
			if(contents || contents === 0) {
				if (_.type(contents) !== 'array') {
					contents = [contents];
				}
				
				var firstChild = element.firstChild;
				
				for (var i=0; i<contents.length; i++) {
					var content = contents[i], child;
					
					switch(_.type(content)) {
						case 'string':
							if(content === '') {
								continue;
							}
							// fall through
						case 'number':
							child = document.createTextNode(content);
							break;
						case 'object':
							child = _.element.create(content);
							break;
						default:
							child = content;

					}
					
					if(child) {
						if (!where || where === 'end') {
							element.appendChild(child);
						}
						else if (where === 'start') {
							element.insertBefore(child, firstChild);
						}
					}
				}	
			}
			
			return element;
		}
609564
function(setter) { // the text value of a node is set to the concatenation of every argument
		return create_list_binding(function(args) {
			return map(args, cjs.get).join("");
		}, function(element, value) {
			setter(element, value);
		});
	}
846566
function createElement(nodeName) {
  var elem = document.createElement(nodeName);
  elem.className = [].join.call(arguments, ' ');
  return elem;
}
1198717
function(el) {

      var menu, span;

      // set element
      el.setAttribute('hashedit-element', '');

      // create element menu
      menu = document.createElement('span');
      menu.setAttribute('class', 'hashedit-element-menu');
      menu.setAttribute('contentEditable', 'false');
      menu.innerHTML = '<label><i class="material-icons">more_vert</i> ' + hashedit.i18n('Content Menu') + '</label>';

      // create a handle
      span = document.createElement('span');
      span.setAttribute('class', 'hashedit-move');
      span.innerHTML = '<i class="material-icons">apps</i> ' + hashedit.i18n('Move');

      // append the handle to the wrapper
      menu.appendChild(span);

      span = document.createElement('span');
      span.setAttribute('class', 'hashedit-properties');
      span.innerHTML = '<i class="material-icons">settings</i> ' + hashedit.i18n('Settings');

      // append the handle to the wrapper
      menu.appendChild(span);

      span = document.createElement('span');
      span.setAttribute('class', 'hashedit-remove');
      span.innerHTML = '<i class="material-icons">cancel</i> ' + hashedit.i18n('Remove');

      // append the handle to the wrapper
      menu.appendChild(span);

      // append the handle to the wrapper
      el.appendChild(menu);

    }
900919
function text(element) {
  var type = element.nodeType
    , value = '';

  if (1 === type || 9 === type || 11 === type) {
    //
    // Use `textContent` instead of `innerText` as it's inconsistent with new
    // lines.
    //
    if ('string' === typeof element.textContent) return element.textContent;

    for (element = element.firstChild; element; element = element.nextSibling) {
      value += text(element);
    }
  }

  return 3 === type || 4 === type
  ? element.nodeValue
  : value;
}
85892
function createElement (
  context,
  tag,
  data,
  children,
  normalizationType,
  alwaysNormalize
) {
  if (Array.isArray(data) || isPrimitive(data)) {
    normalizationType = children;
    children = data;
    data = undefined;
  }
  if (alwaysNormalize) { normalizationType = ALWAYS_NORMALIZE; }
  return _createElement(context, tag, data, children, normalizationType)
}
855462
def set(self, uri, content, **meta):
        
        try:
            node = self._update(uri, content, **meta)
            created = False
        except NodeDoesNotExist:
            node = self._create(uri, content, **meta)
            created = True
        return self._serialize(uri, node), created
953666
def set(self, uri, content):
        
        key, value = self._prepare_node(uri, content)
        self._set(key, value)
1160776
def set_content(self, content):
        
        if self.allows_content:
            self.content = content.strip()
        else:
            raise UNTLStructureException(
                'Element "%s" does not allow textual content' % (self.tag,)
            )
7510
function(o) {

        this.html = (typeof o === "string") ? o : o.html;

        var el = this.getContentEl();
        if (el) {
            el.innerHTML = this.html;
        }

    }
659315
private Element createElement(String namespaceURI, String qName,
                                  Attributes attributes) {
        Element newElement = currentDocument.createElement(qName);

        if (namespaceURI != null && namespaceURI.length() > 0) {
            newElement.setPrefix(namespaceURI);
        }

        for(int i = 0; attributes != null && i < attributes.getLength(); ++i) {
            newElement.setAttribute(attributes.getQName(i),
                                    attributes.getValue(i));
        }

        return newElement;
    }
1098651
function el(tag, attrs) {
  var n = el.air(create(tag));
  if(attrs && n.attr) {
    return n.attr(attrs);
  }
  return n;
}
789141
function(node) {
    node.readability = {"contentScore": 0};

    switch (node.tagName) {
      case 'DIV':
        node.readability.contentScore += 5;
        break;

      case 'PRE':
      case 'TD':
      case 'BLOCKQUOTE':
        node.readability.contentScore += 3;
        break;

      case 'ADDRESS':
      case 'OL':
      case 'UL':
      case 'DL':
      case 'DD':
      case 'DT':
      case 'LI':
      case 'FORM':
        node.readability.contentScore -= 3;
        break;

      case 'H1':
      case 'H2':
      case 'H3':
      case 'H4':
      case 'H5':
      case 'H6':
      case 'TH':
        node.readability.contentScore -= 5;
        break;
    }

    node.readability.contentScore += this._getClassWeight(node);
  }
1074930
def _setContent(self):
        '''
        '''
        kw = KW.copy()
        try:
            kw.update(dict(klass=self.getClassName(),
                       element='ElementDeclaration',
                       literal=self.literalTag(),
                       substitutionGroup=self._substitutionGroupTag(),
                       schema=self.schemaTag(), 
                       init=self.simpleConstructor(),
                       ns=self.ns, name=self.name,
                       aname=self.getAttributeName(self.name),  
                       baseslogic=self.getBasesLogic(ID3),
                       #ofwhat=self.getTypecodeList(),
                       #atypecode=self.attribute_typecode,
                       #pyclass=self.getPyClass(),
                       alias=NAD.getAlias(self.sKlassNS),
                       subclass=type_class_name(self.sKlass),
                       ))
        except Exception, ex:
            args = ['Failure processing an element w/local complexType: %s' %(
                          self._item.getItemTrace())]
            args += ex.args
            ex.args = tuple(args)
            raise
        
        if self.local:
            kw['element'] = 'LocalElementDeclaration'
        
        element = [
            '%(ID1)sclass %(klass)s(%(element)s):',
            '%(ID2)s%(literal)s',
            '%(ID2)s%(schema)s',
            '%(ID2)s%(substitutionGroup)s',
            '%(ID2)s%(init)s',
            '%(ID3)skw["pname"] = ("%(ns)s","%(name)s")',
            '%(ID3)skw["aname"] = "%(aname)s"',
            '%(baseslogic)s',
            '%(ID3)s%(alias)s.%(subclass)s.__init__(self, **kw)',
            '%(ID3)sif self.pyclass is not None: self.pyclass.__name__ = "%(klass)s_Holder"',
            ]

        self.writeArray(map(lambda l: l %kw, element))
562011
def make_element(builder, tag, content):
    """"""
    builder.start(tag, {})
    builder.data(content)  # Must be UTF-8 encoded
    builder.end(tag)
1223782
public void setContents(ArrayList contents) {
		this.contents = contents;
		containsMarkupText = false;
		containsSingleString = false;
		Iterator i = contents.iterator();

		while (i.hasNext()) {
			Object o = i.next();
			if (!(o instanceof Node)) {
				if (o instanceof String && o.toString().trim().length() > 0) {
					if (contents.size() == 1) {
						containsSingleString = true;
					} else {
						containsSingleString = false;
						containsMarkupText = true;
					}
				}
			} else {
				Node node = (Node) o;
//				node.setDepth(depth + 1);
				node.parentNode = this instanceof Node ? (Node) this : null;
			}
		}
	}
534146
function() {
			var options;

			if(_.type(arguments[0]) === 'string') {
				if(_.type(arguments[1]) === 'object') {
					// Utopia.element.create('div', { ... });
					options = arguments[1];
					options.tag = arguments[0];
				}
				else {
					// Utopia.element.create('div', ...);
					options = {
						tag: arguments[0]
					};
					
					// Utopia.element.create('div', [contents]);
					if(_.type(arguments[1]) === 'array') {
						options.contents = arguments[1];
					}
					// Utopia.element.create('div', 'Text contents');
					else if(_.type(arguments[1]) === 'string' || _.type(arguments[1]) === 'number') {
						options.contents = ['' + arguments[1]];
					}
				}
			}
			else {
				options = arguments[0];
			}
			
			var namespace = options.namespace || '', element;
			
			if(namespace) {
				element = document.createElementNS(namespace, options.tag);
			}
			else {
				element = document.createElement(options.tag);
			}
			
			if (options.className || options.id) {
				options.properties = options.properties || {};
				options.properties.className = options.className;
				options.properties.id = options.id;
			}
			
			// Set properties, attributes and contents
			_.element.set(element, options);
			
			// Place the element in the DOM (inside, before or after an existing element)
			// This could be a selector
			if(options.before) {
				var before = $(options.before);
				
				if (before && before.parentNode) {
					before.parentNode.insertBefore(element, before);
				}
			}
			
			if (options.after && element.parentNode === null) {
				var after = $(options.after);
				
				if (after && after.parentNode) {
					after.parentNode.insertBefore(element, after.nextSibling)
				}
			}
			
			if (options.inside && element.parentNode === null) {
				$(options.inside).appendChild(element);
			}
			
			return element;
		}