Adds a new namespace
@return the current instance of <code>BatchXMLDescriptor</code>
431787
public BatchXMLDescriptor addNamespace(String name, String value)
   {
      model.attribute(name, value);
      return this;
   }
99623
def add(self, namespace_uri):
        """"""
        # See if this namespace is already mapped to an alias
        alias = self.namespace_to_alias.get(namespace_uri)
        if alias is not None:
            return alias

        # Fall back to generating a numerical alias
        i = 0
        while True:
            alias = 'ext' + str(i)
            try:
                self.addAlias(namespace_uri, alias)
            except KeyError:
                i += 1
            else:
                return alias

        assert False, "Not reached"
1066886
public final BELScriptParser.define_namespace_return define_namespace() throws RecognitionException {
        BELScriptParser.define_namespace_return retval = new BELScriptParser.define_namespace_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token string_literal33=null;
        Token string_literal34=null;
        Token string_literal35=null;
        Token OBJECT_IDENT36=null;
        Token string_literal37=null;
        Token string_literal38=null;
        BELScriptParser.quoted_value_return quoted_value39 = null;


        Object string_literal33_tree=null;
        Object string_literal34_tree=null;
        Object string_literal35_tree=null;
        Object OBJECT_IDENT36_tree=null;
        Object string_literal37_tree=null;
        Object string_literal38_tree=null;

         paraphrases.push("in define namespace."); 
        try {
            // BELScript.g:98:5: ( ( 'DEFINE' ( ( 'DEFAULT' )? 'NAMESPACE' ) ) OBJECT_IDENT 'AS' 'URL' quoted_value )
            // BELScript.g:99:5: ( 'DEFINE' ( ( 'DEFAULT' )? 'NAMESPACE' ) ) OBJECT_IDENT 'AS' 'URL' quoted_value
            {
            root_0 = (Object)adaptor.nil();

            // BELScript.g:99:5: ( 'DEFINE' ( ( 'DEFAULT' )? 'NAMESPACE' ) )
            // BELScript.g:99:6: 'DEFINE' ( ( 'DEFAULT' )? 'NAMESPACE' )
            {
            string_literal33=(Token)match(input,27,FOLLOW_27_in_define_namespace429); 
            string_literal33_tree = (Object)adaptor.create(string_literal33);
            adaptor.addChild(root_0, string_literal33_tree);

            // BELScript.g:99:15: ( ( 'DEFAULT' )? 'NAMESPACE' )
            // BELScript.g:99:16: ( 'DEFAULT' )? 'NAMESPACE'
            {
            // BELScript.g:99:16: ( 'DEFAULT' )?
            int alt6=2;
            int LA6_0 = input.LA(1);

            if ( (LA6_0==28) ) {
                alt6=1;
            }
            switch (alt6) {
                case 1 :
                    // BELScript.g:99:17: 'DEFAULT'
                    {
                    string_literal34=(Token)match(input,28,FOLLOW_28_in_define_namespace433); 
                    string_literal34_tree = (Object)adaptor.create(string_literal34);
                    adaptor.addChild(root_0, string_literal34_tree);


                    }
                    break;

            }

            string_literal35=(Token)match(input,29,FOLLOW_29_in_define_namespace437); 
            string_literal35_tree = (Object)adaptor.create(string_literal35);
            adaptor.addChild(root_0, string_literal35_tree);


            }


            }

            OBJECT_IDENT36=(Token)match(input,OBJECT_IDENT,FOLLOW_OBJECT_IDENT_in_define_namespace441); 
            OBJECT_IDENT36_tree = (Object)adaptor.create(OBJECT_IDENT36);
            adaptor.addChild(root_0, OBJECT_IDENT36_tree);

            string_literal37=(Token)match(input,30,FOLLOW_30_in_define_namespace443); 
            string_literal37_tree = (Object)adaptor.create(string_literal37);
            adaptor.addChild(root_0, string_literal37_tree);

            string_literal38=(Token)match(input,31,FOLLOW_31_in_define_namespace445); 
            string_literal38_tree = (Object)adaptor.create(string_literal38);
            adaptor.addChild(root_0, string_literal38_tree);

            pushFollow(FOLLOW_quoted_value_in_define_namespace447);
            quoted_value39=quoted_value();

            state._fsp--;

            adaptor.addChild(root_0, quoted_value39.getTree());

            }

            retval.stop = input.LT(-1);

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

             paraphrases.pop(); 
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
583093
public WebFacesUIComponentDescriptor addNamespace(String name, String value)
   {
      model.attribute(name, value);
      return this;
   }
254186
public static NamespaceContext
        toNamespaceContext(Map<String, String> prefix2URI) {
        final Map<String, String> copy =
            new LinkedHashMap<String, String>(prefix2URI);
        return new NamespaceContext() {
            public String getNamespaceURI(String prefix) {
                if (prefix == null) {
                    throw new IllegalArgumentException("prefix must not be null");
                }
                if (XMLConstants.XML_NS_PREFIX.equals(prefix)) {
                    return XMLConstants.XML_NS_URI;
                }
                if (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix)) {
                    return XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
                }
                String uri = copy.get(prefix);
                return uri != null ? uri : XMLConstants.NULL_NS_URI;
            }

            public String getPrefix(String uri) {
                Iterator i = getPrefixes(uri);
                return i.hasNext() ? (String) i.next() : null;
            }

            public Iterator getPrefixes(String uri) {
                if (uri == null) {
                    throw new IllegalArgumentException("uri must not be null");
                }
                Collection<String> c = new LinkedHashSet<String>();
                boolean done = false;
                if (XMLConstants.XML_NS_URI.equals(uri)) {
                    c.add(XMLConstants.XML_NS_PREFIX);
                    done = true;
                }
                if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(uri)) {
                    c.add(XMLConstants.XMLNS_ATTRIBUTE);
                    done = true;
                }
                if (!done) {
                    for (Map.Entry<String, String> entry : copy.entrySet()) {
                        if (uri.equals(entry.getValue())) {
                            c.add(entry.getKey());
                        }
                    }
                }
                return c.iterator();
            }
        };
    }
1003096
@Nonnull
  public final XMLWriterSettings setNamespaceContext (@Nullable final INamespaceContext aNamespaceContext)
  {
    // A namespace context must always be present, to resolve default namespaces
    m_aNamespaceContext = aNamespaceContext != null ? aNamespaceContext : new MapBasedNamespaceContext ();
    return this;
  }
759458
public StringBuffer addXML(StringBuffer sbXML)
    {
        if (sbXML == null)
            sbXML = new StringBuffer();
        Util.addStartTag(sbXML, BaseMessage.HEADER_TAG).append(DBConstants.RETURN);
        Map<String,Object> map = this.getProperties();
        Util.addXMLMap(sbXML, map);
        Util.addEndTag(sbXML, BaseMessage.HEADER_TAG).append(DBConstants.RETURN);
        return sbXML;
    }
873689
public static Namespace convert(
            final org.openbel.framework.common.model.Namespace ns) {
        Namespace ws = OBJECT_FACTORY.createNamespace();
        ws.setPrefix(ns.getPrefix());
        ws.setResourceLocation(ns.getResourceLocation());
        return ws;
    }
694866
@POST
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    @Description("Creates a new namepsace.")
    public NamespaceDto createNamespace(@Context HttpServletRequest req, NamespaceDto namespaceDto) {
        if (namespaceDto == null) {
            throw new WebApplicationException("Null namespace object cannot be created.", Status.BAD_REQUEST);
        }

        PrincipalUser remoteUser = validateAndGetOwner(req, null);
        Set<PrincipalUser> users = _getPrincipalUserByUserName(namespaceDto.getUsernames());
        Namespace namespace = new Namespace(remoteUser, namespaceDto.getQualifier(), remoteUser, users);

        return NamespaceDto.transformToDto(_namespaceService.createNamespace(namespace));
    }
1076196
def _add_namespace(self, namespace):
        """"""
        src_name = namespace.source_name
        if "*" in src_name:
            self._regex_map.append((namespace_to_regex(src_name), namespace))
        else:
            self._add_plain_namespace(namespace)
1017563
public WebFragmentDescriptor addNamespace(String name, String value)
   {
      model.attribute(name, value);
      return this;
   }
648185
public void addNamespace( String prefix, String uri, String elementName ) {
      if( StringUtils.isBlank( uri ) ){
         return;
      }
      if( prefix == null ){
         prefix = "";
      }
      if( StringUtils.isBlank( elementName ) ){
         rootNamespace.put( prefix.trim(), uri.trim() );
      }else{
         Map nameSpaces = (Map) namespacesPerElement.get( elementName );
         if( nameSpaces == null ){
            nameSpaces = new TreeMap();
            namespacesPerElement.put( elementName, nameSpaces );
         }
         nameSpaces.put( prefix, uri );
      }
   }
151911
public WebFacesPartialResponseDescriptor addNamespace(String name, String value)
   {
      model.attribute(name, value);
      return this;
   }
1032033
protected synchronized static SAXParserFactory getSaxFactory()
    {
        if (sSaxFactory == null) {
            sSaxFactory = SAXParserFactory.newInstance();
            sSaxFactory.setNamespaceAware(true); 
        }
        return sSaxFactory;
    }
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);

    }
1114073
protected XmlEmit getXml() throws Throwable {
    final XmlEmit xml = new XmlEmit();

    for (final String ns: nameSpaces) {
      addNs(xml, ns);
    }

    return xml;
  }
178160
public ElemTemplateElement appendChild(ElemTemplateElement newChild)
  {

    int type = ((ElemTemplateElement) newChild).getXSLToken();

    switch (type)
    {
    case Constants.ELEMNAME_TEXTLITERALRESULT :
      break;
    default :
      error(XSLTErrorResources.ER_CANNOT_ADD,
            new Object[]{ newChild.getNodeName(),
                          this.getNodeName() });  //"Can not add " +((ElemTemplateElement)newChild).m_elemName +

    //" to " + this.m_elemName);
    }

    return super.appendChild(newChild);
  }