Adds the COXB namespace and associated prefixes to the XML schema.
494583
protected void addNamespaceContext() {
        NamespaceMap prefixmap = new NamespaceMap();
        NamespacePrefixList npl = getXsd().getNamespaceContext();
        if (npl == null) {
            /* We get an NPE if we don't add this. */
            prefixmap.add("", XMLConstants.W3C_XML_SCHEMA_NS_URI);
        } else {
            for (int i = 0; i < npl.getDeclaredPrefixes().length; i++) {
                prefixmap.add(npl.getDeclaredPrefixes()[i],
                        npl.getNamespaceURI(npl.getDeclaredPrefixes()[i]));
            }
        }
        prefixmap.add(getCOXBNamespacePrefix(), getCOXBNamespace());
        getXsd().setNamespaceContext(prefixmap);

    }
1328795
def updateObjectFromXML(xml_doc, obj, mapping):
    
    nsmap = None
    if isinstance(mapping, dict):
        # The special key @namespaces is used to pass
        # namespaces and prefix mappings for xpath selectors.
        # e.g. {'x': 'http://example.com/namespace'}
        if '@namespaces' in mapping:
            nsmap = mapping['@namespaces']
    else:
        raise TypeError('Tag-to-property map must be a dict.')
    # Iterate over the keys of the translation dictionary from event objects
    # to xml objects, so we can update the fields with the new information
    for k, v in mapping.items():
        if k.startswith('@'):
            continue
        selected_text = None
        if isinstance(v, basestring):
            selector = v
        elif isinstance(v, list):
            selector = '/'.join(v)
        else:
            raise TypeError(
                'Invalid tag-to-property mapping dict: '
                'values must be strings or lists, not %s.' % (type(v),)
            )
        try:
            selected_text = xml_doc.xpath(selector, namespaces=nsmap)
            if isinstance(selected_text, list):
                selected_text = selected_text[0]
            selected_text = selected_text.text
            setattr(obj, k, selected_text)
        except IndexError:
            # Assume the value is missing. It's also possible that the
            # given selector is valid but wrong, but the more common
            # case is that the element is missing. To be consistent with
            # the prior implementation, empty resultsets just mean empty
            # attributes.
            continue
    return obj
645026
private function addNamespaceAttributes(ClassMetadata $metadata, \DOMElement $element): void
    {
        foreach ($metadata->xmlNamespaces as $prefix => $uri) {
            $attribute = 'xmlns';
            if ('' !== $prefix) {
                $attribute .= ':' . $prefix;
            } elseif ($element->namespaceURI === $uri) {
                continue;
            }
            $element->setAttributeNS('http://www.w3.org/2000/xmlns/', $attribute, $uri);
        }
    }
1264021
public JobXMLDescriptor addNamespace(String name, String value)
   {
      model.attribute(name, value);
      return this;
   }
1304588
private Map<String,Namespace> buildByPrefixMap()
    {
        int len = mNamespaces.size();
        if (len == 0) {
            return Collections.emptyMap();
        }

        LinkedHashMap<String,Namespace> m = new LinkedHashMap<String,Namespace>(1 + len + (len>>1));
        for (int i = 0; i < len; ++i) {
            Namespace ns = mNamespaces.get(i);
            String prefix = ns.getPrefix();
            if (prefix == null) { // shouldn't happen but...
                prefix = "";
            }
            m.put(prefix, ns);
        }
        return m;
    }
916596
def append(self):
        
        tag = self._schema.tag
        children = self._root.getchildren()
        if len(children) >= self._schema.max_occurs:
            raise WSDLParseError("Too many items in tag '%s'" % tag)
        schema = self._schema.child
        tag = "item"
        if self._namespace is not None:
            tag = "{%s}%s" % (self._namespace, tag)
        child = etree.SubElement(self._root, tag)
        return schema.create(child)
428940
def add(ns, element_name, value, attributes={})
      element = REXML::Element.new(element_name)
      if ns.is_a?(Namespace)
        unless ns.prefix.nil? || ns.prefix.empty?
          element.name = "#{ns.prefix}:#{element_name}"
          element.add_namespace ns.prefix, ns.uri unless @ns == ns || @ns == ns.uri
        else
          element.add_namespace ns.uri unless @ns == ns || @ns == ns.uri
        end
      else
        element.add_namespace ns unless @ns == ns || @ns.to_s == ns
      end
      if value.is_a?(Element)
        value.elem.each_element do |e|
          element.add e.deep_clone
        end
        value.elem.attributes.each_attribute do |a|
          unless a.name =~ /^xmlns(?:\:)?/
            element.add_attribute a
          end
        end
        #element.text = value.elem.text unless value.elem.text.nil?
        text = value.elem.get_text
        unless text.nil?
          element.text = REXML::Text.new(text.to_s, true, nil, true)
        end
      else
        if value.is_a?(REXML::Element)
          element.add_element value.deep_clone
        else
          element.add_text value.to_s
        end
      end
      element.add_attributes attributes unless attributes.nil?
      @elem.add_element element
    end
1171740
def add_prefix(prefix, s):
    ""
    # tokenize the XPath expression
    toks = xpath_lexer.scan(s)
    # add default prefix to unprefixed names
    toks2 = [_add_prefix(prefix, tok) for tok in toks]
    # build a string of the patched expression
    ls = [x.value for x in toks2]
    return ''.join(ls)
723754
def register_prefix(self, nspair):
        
        for prefix, uri in nspair.items():
            try:
                ElementTree.register_namespace(prefix, uri)
            except AttributeError:
                # Backwards compatibility with ET < 1.3
                ElementTree._namespace_map[uri] = prefix
            except ValueError:
                pass
156020
def addIncludeSchema(self, schemaLocation, schema):
        
        if not isinstance(schema, XMLSchema):
            raise TypeError, 'expecting a Schema instance'
        if not schema.targetNamespace or\
             schema.targetNamespace == self.targetNamespace:
            self._included_schemas[schemaLocation] = schema
        else:
            raise SchemaError, 'include schema bad targetNamespace'
171848
public PersistenceDescriptor addNamespace(String name, String value)
   {
      model.attribute(name, value);
      return this;
   }
239619
def add(self, text="", default_continuousAdd=True):
		""""""
		if not text and default_continuousAdd:
			self.continuousAdd()
		else:
			pprefix = ""
			for x,y in self.rdflib_graph.namespaces():
				pprefix += "@prefix %s: <%s> . \n" % (x, y)
			# add final . if missing
			if text and (not text.strip().endswith(".")):
				text += " ."
			# smart replacements
			text = text.replace(" sub ", " rdfs:subClassOf ")
			text = text.replace(" class ", " owl:Class ")
			# finally
			self.rdflib_graph.parse(data=pprefix+text, format="turtle")
976662
public function addProjectNamespaces()
    {
        $classLoader = $this->getConfig("runtime.classLoader");
        $classLoader->setPsr4(self::getNamespace() . "\\", self::getSRCPath());
    }
809613
protected void namespaceImpl(String prefix, String namespaceURI) {
        if (! (this.xmlNode instanceof Element)) {
            throw new RuntimeException(
                "Cannot add an attribute to non-Element underlying node: "
                + this.xmlNode);
        }
        if (prefix != null && prefix.length() > 0) {
            ((Element) xmlNode).setAttributeNS("http://www.w3.org/2000/xmlns/",
                "xmlns:" + prefix, namespaceURI);
        } else {
            ((Element) xmlNode).setAttributeNS("http://www.w3.org/2000/xmlns/",
                "xmlns", namespaceURI);
        }
    }
589197
private void addAliasDeclarationNodes() {
    for (Entry<String, StringInfo> entry : stringInfoMap.entrySet()) {
      StringInfo info = entry.getValue();
      if (!info.isAliased) {
        continue;
      }
      String alias = info.getVariableName(entry.getKey());
      Node var = IR.var(IR.name(alias), IR.string(entry.getKey()));
      var.useSourceInfoFromForTree(info.parentForNewVarDecl);
      if (info.siblingToInsertVarDeclBefore == null) {
        info.parentForNewVarDecl.addChildToFront(var);
      } else {
        info.parentForNewVarDecl.addChildBefore(
            var, info.siblingToInsertVarDeclBefore);
      }
      compiler.reportChangeToEnclosingScope(var);
    }
  }
1174923
public void addNameSpace(Set<String> names) {
		for (String name : names) {
			this.nameSpace.add(name.replace('.', '/'));
		}
	}
41066
def put(self, namespacePrefix):
        """"""
        self.reqparse.add_argument('name', type=str, required=True)
        self.reqparse.add_argument('sortOrder', type=int, required=True)
        args = self.reqparse.parse_args()

        ns = db.ConfigNamespace.find_one(ConfigNamespace.namespace_prefix == namespacePrefix)
        if not ns:
            return self.make_response('No such namespace: {}'.format(namespacePrefix), HTTP.NOT_FOUND)

        ns.name = args['name']
        ns.sort_order = args['sortOrder']
        db.session.add(ns)
        db.session.commit()

        self.dbconfig.reload_data()
        auditlog(event='configNamespace.update', actor=session['user'].username, data=args)

        return self.make_response('Namespace updated')