Create an Element for a given name, prefix and uri.
This uses the document builder associated with the current thread.
545438
public static Element createElement(String localPart, String prefix, String uri)
   {
      Document doc = getOwnerDocument();
      if (prefix == null || prefix.length() == 0)
      {
         if (ROOT_LOGGER.isTraceEnabled()) ROOT_LOGGER.trace("createElement {" + uri + "}" + localPart);
         return doc.createElementNS(uri, localPart);
      }
      else
      {
         if (ROOT_LOGGER.isTraceEnabled()) ROOT_LOGGER.trace("createElement {" + uri + "}" + prefix + ":" + localPart);
         return doc.createElementNS(uri, prefix + ":" + localPart);
      }
   }
562011
def make_element(builder, tag, content):
    """"""
    builder.start(tag, {})
    builder.data(content)  # Must be UTF-8 encoded
    builder.end(tag)
28433
public static Element createElement(QName qname)
   {
      return createElement(qname.getLocalPart(), qname.getPrefix(), qname.getNamespaceURI());
   }
930605
private static void createElement(String apiName) {
        ClassWriter classWriter = generateClass(ELEMENT, JAVA_OBJECT, null, "<T::" + elementTypeDesc + "Z::" + elementTypeDesc + ">" + JAVA_OBJECT_DESC, ACC_PUBLIC + ACC_ABSTRACT + ACC_INTERFACE, apiName);

        MethodVisitor mVisitor = classWriter.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, "self", "()" + elementTypeDesc, "()TT;", null);
        mVisitor.visitEnd();
        mVisitor = classWriter.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, "getVisitor", "()" + elementVisitorTypeDesc, null, null);
        mVisitor.visitEnd();
        mVisitor = classWriter.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, "getName", "()" + JAVA_STRING_DESC, null, null);
        mVisitor.visitEnd();
        mVisitor = classWriter.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, "__", "()" + elementTypeDesc, "()TZ;", null);
        mVisitor.visitEnd();
        mVisitor = classWriter.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, "getParent", "()" + elementTypeDesc, "()TZ;", null);
        mVisitor.visitEnd();

        writeClassToFile(ELEMENT, classWriter, apiName);
    }
259538
def create(self, name, description='', template=100):
        
        try:
            template = int(template)
        except ValueError:
            template = LIST_TEMPLATES[template]
        if name in self:
            raise ValueError("List already exists: '{0}".format(name))
        if uuid_re.match(name):
            raise ValueError("Cannot create a list with a UUID as a name")
        xml = SP.AddList(SP.listName(name),
                         SP.description(description),
                         SP.templateID(text_type(template)))
        result = self.opener.post_soap(LIST_WEBSERVICE, xml,
                                       soapaction='http://schemas.microsoft.com/sharepoint/soap/AddList')
        list_element = result.xpath('sp:AddListResult/sp:List', namespaces=namespaces)[0]
        self._all_lists.append(SharePointList(self.opener, self, list_element))
26750
function makeElement(tagName, attributes) {
    var el = fabric.document.createElement(tagName);
    for (var prop in attributes) {
      if (prop === 'class') {
        el.className = attributes[prop];
      }
      else if (prop === 'for') {
        el.htmlFor = attributes[prop];
      }
      else {
        el.setAttribute(prop, attributes[prop]);
      }
    }
    return el;
  }
1063517
def start_element(self, name, attrs):
        """"""
        self.in_tag = (name == self.tag)
        self.url = u""
789166
def createDocument(self, namespaceURI, localName, doctype=None):
        '''
        '''
        prefix = self._soap_env_prefix

        if namespaceURI == self.reserved_ns[prefix]:
            qualifiedName = '%s:%s' %(prefix,localName)
        elif namespaceURI is localName is None:
            self.node = self._dom.createDocument(None,None,None)
            return
        else:
            raise KeyError, 'only support creation of document in %s' %self.reserved_ns[prefix]

        document = self._dom.createDocument(nsuri=namespaceURI, qname=qualifiedName, doctype=doctype)
        self.node = document.childNodes[0]

        #set up reserved namespace attributes
        for prefix,nsuri in self.reserved_ns.items():
            self._setAttributeNS(namespaceURI=self._xmlns_nsuri, 
                qualifiedName='%s:%s' %(self._xmlns_prefix,prefix), 
                value=nsuri)
886066
def create_web_element(self, element_id):
        """"""
        return self._web_element_cls(self, element_id, w3c=self.w3c)
566666
@Override
  public DocumentDescriptor create(DocumentUriTemplate template, W contentHandle)
    throws ForbiddenUserException, FailedRequestException {
    return create(template, null, contentHandle, null, null, null, null, null);
  }
581496
public Element createElementNS(String namespaceURI, String qualifiedName)
          throws DOMException
  {

    error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);

    return null;
  }
459079
def createElement(self, token):
        """"""
        name = token["name"]
        namespace = token.get("namespace", self.defaultNamespace)
        element = self.elementClass(name, namespace)
        element.attributes = token["data"]
        return element
161145
function createElement(config){
    var isConfig = config != undefined && typeof config != 'string';
    var description = (isConfig ? config.description : config) || '';

    var elementName = 'div'; // modern browsers become case sensetive for tag names for xhtml
    var element;

    // fetch tag name
    var m = description.match(/^([a-z0-9_\-]+)(.*)$/i);
    if (m)
    {
      elementName = m[1];
      description = m[2];
    }

    // create an element

    if (description != '')
    {
      // extract properties
      var classNames = [];
      var attributes = {};
      var entryName;

      while (m = DESCRIPTION_PART_REGEXP.exec(description))
      {
        if (m[8])
        {
          throw new Error(
            'Create element error in basis.dom.createElement()' +
            '\n\nDescription:\n> ' + description +
            '\n\nProblem place:\n> ' + description.substr(0, m.index) + '-->' + description.substr(m.index) + '<--'
          );
        }

        entryName = m[1] || m[2] || m[3];

        if (m[1])     // id
          attributes.id = entryName;
        else
          if (m[2])   // class
            classNames.push(entryName);
          else
          {           // attribute
            if (entryName != 'class')
              attributes[entryName] = m[4] ? m[5] || m[6] || m[7] || '' : entryName;
          }
      }

      // create element
      if (IS_ATTRIBUTE_BUG_NAME && attributes.name && /^(input|textarea|select)$/i.test(elementName))
        elementName = '<' + elementName + ' name=' + attributes.name + '>';
    }

    // create element
    element = document.createElement(elementName);

    // set attributes
    if (attributes)
    {
      if (attributes.style && IS_ATTRIBUTE_BUG_STYLE)
        element.style.cssText = attributes.style;

      for (var attrName in attributes)
        element.setAttribute(attrName, attributes[attrName], 0);
    }

    // set css classes
    if (classNames && classNames.length)
      element.className = classNames.join(' ');

    // append child nodes
    if (arguments.length > 1)
      handleInsert(element, createFragment.apply(0, basis.array.flatten(arrayFrom(arguments, 1))));

    // attach event handlers
    if (isConfig)
    {
      if (config.css)
      {
        if (!cssom)
          cssom = require('basis.cssom');
        cssom.setStyle(element, config.css);
      }

      for (var event in config)
        if (typeof config[event] == 'function')
          eventUtils.addHandler(element, event, config[event], element);
    }

    // return an element
    return element;
  }
1248100
def WriteXml(self, w, option, elementName=None):
		
		if (option == WriteXmlOption.Dirty and not self.IsDirty()):
			return
		if elementName == None:
			x = w.createElement(self.propMoMeta.xmlAttribute)
		else:
			x = w.createElement(elementName)
		if UcsUtils.FindClassIdInMoMetaIgnoreCase(self.classId) != None:
			for at in UcsUtils.GetUcsPropertyMetaAttributeList(self.classId):
				atMeta = UcsUtils.GetUcsPropertyMeta(self.classId, at)
				if (atMeta.access == UcsPropertyMeta.Internal):
					continue
				elif ((option != WriteXmlOption.Dirty) or (
							(atMeta.mask != None) and (self.dirtyMask & atMeta.mask) != 0)):
					if (getattr(self, at) != None):
						x.setAttribute(atMeta.xmlAttribute, getattr(self, at))
		# Adding XtraProperties from object into Xml query document
		for xtraProp in self.__dict__['XtraProperty']:
			x.setAttribute(UcsUtils.WordL(xtraProp), self.__dict__['XtraProperty'][xtraProp])
		x_child = self.childWriteXml(w, option)
		for xc in x_child:
			if (xc != None):
				x.appendChild(xc)
		return x
739790
public Element append(String name, String value) {
		Element child = document.createElementNS(XCAL_NS, name);
		child.setTextContent(value);
		element.appendChild(child);
		return child;
	}
829413
def StartElement(self, name, attributes):
        '''
        
        '''
        if name == 'hierarchy':
            pass
        elif name == 'node':
            # Instantiate an Element object
            attributes['uniqueId'] = 'id/no_id/%d' % self.idCount
            bounds = re.split('[\][,]', attributes['bounds'])
            attributes['bounds'] = ((int(bounds[1]), int(bounds[2])), (int(bounds[4]), int(bounds[5])))
            if DEBUG_BOUNDS:
                print >> sys.stderr, "bounds=", attributes['bounds']
            self.idCount += 1
            child = View.factory(attributes, self.device, version=self.version, uiAutomatorHelper=self.uiAutomatorHelper)
            self.views.append(child)
            # Push element onto the stack and make it a child of parent
            if not self.nodeStack:
                self.root = child
            else:
                self.parent = self.nodeStack[-1]
                self.parent.add(child)
            self.nodeStack.append(child)
1243948
def to_xml(self, root):
        '''
        
        '''
        if not len(self.__custom_elements):
            return

        for uri, tags in self.__custom_elements.items():
            prefix, url = uri.split(":", 1)
            for name, value in tags.items():
                self.__createElementNS(root, url, prefix + ":" + name, value)

        return root