Adds the specified DocElement to the docstring list. However, if an
        element with the same xml tag and pointsto value already exists, it
        will be overwritten.
761775
def overwrite_docs(self, doc):
        """"""
        for i in range(len(self.docstring)):
            if (self.docstring[i].doctype == doc.doctype and
                self.docstring[i].pointsto == doc.pointsto):
                del self.docstring[i]
                break

        self.docstring.append(doc)
1155248
def add(self, element):
        
        if not isinstance(element, six.string_types):
            raise TypeError("Hll elements can only be strings")
        self._adds.add(element)
876259
public synchronized void addElement(T element) {
		List<T> origList = ref.get().list;
		boolean isPresent = origList.contains(element);
		if (isPresent) {
			return;
		}
		
		List<T> newList = new ArrayList<T>(origList);
		newList.add(element);
		
		swapWithList(newList);
	}
1052969
def _add_domains_xml(self, document):
        
        for domain, attrs in self.domains.items():
            domain_element = document.createElement('allow-access-from')
            domain_element.setAttribute('domain', domain)
            if attrs['to_ports'] is not None:
                domain_element.setAttribute(
                    'to-ports',
                    ','.join(attrs['to_ports'])
                )
            if not attrs['secure']:
                domain_element.setAttribute('secure', 'false')
            document.documentElement.appendChild(domain_element)
176795
public void addInlineComment(Element element, DocTree tag, Content htmltree) {
        CommentHelper ch = utils.getCommentHelper(element);
        List<? extends DocTree> description = ch.getDescription(configuration, tag);
        addCommentTags(element, tag, description, false, false, htmltree);
    }
176856
def save_xml(self, doc, element):
        ''''''
        element.setAttributeNS(XSI_NS, XSI_NS_S + 'type', 'rtsExt:serviceport_ext')
        element.setAttributeNS(RTS_NS, RTS_NS_S + 'name', self.name)
        if self.comment:
            element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'comment',
                                   self.comment)
        if self.visible != True:
            element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'visible',
                                   str(self.visible).lower())
        for p in self.properties:
            new_prop_element = doc.createElementNS(RTS_EXT_NS,
                                                   RTS_EXT_NS_S + 'Properties')
            properties_to_xml(new_prop_element, p, self.properties[p])
            element.appendChild(new_prop_element)
738109
private synchronized void appendXMLProperty(Document doc, Element conf,
	                                            String propertyName) {
		// skip writing if given property name is empty or null
		if (!Strings.isNullOrEmpty(propertyName)) {
			String value = properties.getProperty(propertyName);
			if (value != null) {
				Element propNode = doc.createElement("property");
				conf.appendChild(propNode);

				Element nameNode = doc.createElement("name");
				nameNode.appendChild(doc.createTextNode(propertyName));
				propNode.appendChild(nameNode);

				Element valueNode = doc.createElement("value");
				valueNode.appendChild(doc.createTextNode(
						properties.getProperty(propertyName)));
				propNode.appendChild(valueNode);

				Element finalNode = doc.createElement("final");
				finalNode.appendChild(doc.createTextNode(
						String.valueOf(finalParameters.contains(propertyName))));
				propNode.appendChild(finalNode);

				if (updatingResource != null) {
					String[] sources = updatingResource.get(propertyName);
					if(sources != null) {
						for(String s : sources) {
							Element sourceNode = doc.createElement("source");
							sourceNode.appendChild(doc.createTextNode(s));
							propNode.appendChild(sourceNode);
						}
					}
				}
			}
		}
	}
456400
public void addElement(int value)
  {

    if (!m_mutable)
      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");

    super.addElement(value);
  }
838463
public void addNode(int n)
  {

    if (!m_mutable)
      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");

    this.addElement(n);
  }
16428
private void addOnlyOfTypeElements() {
        for (Node node : nodes) {
            Node n = DOMHelper.getPreviousSiblingElement(node);
            while (n != null) {
                if (DOMHelper.getNodeName(n).equals(DOMHelper.getNodeName(node))) {
                    break;
                }
                
                n = DOMHelper.getPreviousSiblingElement(n);
            }
            
            if (n == null) {
                n = DOMHelper.getNextSiblingElement(node);
                while (n != null) {
                    if (DOMHelper.getNodeName(n).equals(DOMHelper.getNodeName(node))) {
                        break;
                    }
                    
                    n = DOMHelper.getNextSiblingElement(n);
                }
                
                if (n == null) {
                    result.add(node);
                }
            }
        }
    }
583266
public static void appendChild(Document doc, Element parentElement, String elementName, String elementValue) {
        Element child = doc.createElement(elementName);
        Text text = doc.createTextNode(elementValue);
        child.appendChild(text);
        parentElement.appendChild(child);
    }
935951
static Element appendChild(Element plfChild, Element parent, boolean copyChildren) {
        Document document = parent.getOwnerDocument();
        Element copy = (Element) document.importNode(plfChild, false);
        parent.appendChild(copy);

        // set the identifier for the doc if warrented
        String id = copy.getAttribute(Constants.ATT_ID);
        if (id != null && !id.equals("")) copy.setIdAttribute(Constants.ATT_ID, true);

        if (copyChildren) {
            NodeList children = plfChild.getChildNodes();
            for (int i = 0; i < children.getLength(); i++) {
                if (children.item(i) instanceof Element)
                    appendChild((Element) children.item(i), copy, true);
            }
        }
        return copy;
    }
654879
def save_xml(self, doc, element):
        ''''''
        element.setAttributeNS(RTS_NS, RTS_NS_S + 'id', self.id)
        for c in self._config_data:
            new_element = doc.createElementNS(RTS_NS,
                                              RTS_NS_S + 'ConfigurationData')
            c.save_xml(doc, new_element)
            element.appendChild(new_element)
155680
def addObjectFromXML(xmlObject, XMLToObjectFunc,
                     topLevelName, idKey, updateList):
    

    # Get the current object to update
    contentElement = getNodeByName(xmlObject, "content")
    objectNode = getNodeByName(contentElement, topLevelName)
    dupObjects = None
    newObject = XMLToObjectFunc(objectNode)
    try:
        kwargs = {idKey: getattr(newObject, idKey)}
        dupObjects = type(newObject).objects.filter(**kwargs)
    except type(newObject).DoesNotExist:
        pass
    if dupObjects and dupObjects.count() > 1:
        raise Exception(
            "Duplicate object with identifier %s" % getattr(newObject, idKey)
        )
    newObject.save()
    return newObject
1255164
private void addToCreateElements(String elementName) {
        HashMap<String, String> elementAttributes = new HashMap<>();

        elementAttributes.put(XsdAbstractElement.NAME_TAG, elementName);

        if (!createdElements.containsKey(getCleanName(elementName))){
            createdElements.put(getCleanName(elementName), new XsdElement(null, elementAttributes));
        }
    }
115670
protected void adoptElement(DomXmlElement elementToAdopt) {
    Document document = this.domElement.getOwnerDocument();
    Element element = elementToAdopt.domElement;

    if (!document.equals(element.getOwnerDocument())) {
      Node node = document.adoptNode(element);
      if (node == null) {
        throw LOG.unableToAdoptElement(elementToAdopt);
      }
    }
  }
620317
public boolean add(SeLionElement element) {
        // if already initialized, add the new elements to the front of the list.
        if (initialized) {
            CodeGeneratorLogger logger = CodeGeneratorLoggerFactory.getLogger();

            // info messages are only displayed after initialization happens
            if (isExactMatch(element.getElementClass())) {
                logger.info("Registering the element " + element + " which is now overwriting a pre-existing element.");
            } else {
                logger.info("Registering the element " + element + " as a valid element.");
            }

            SeLionElementSet elementSet = (SeLionElementSet) clone();
            clear();
            super.add(element);
            elementSet.stream().forEachOrdered(a -> super.add(a));
            return true;
        }
        return super.add(element);
    }