Get the XSD Schema object for the UBL 2.1 document type of the passed
namespace.

@param sNamespace
The namespace URI of any UBL 2.1 document type. May be
<code>null</code>.
@return <code>null</code> if no such UBL 2.1 document type exists.
771114
@Nullable
  public static Schema getSchemaOfNamespace (@Nullable final String sNamespace)
  {
    final EUBL21DocumentType eDocType = getDocumentTypeOfNamespace (sNamespace);
    return eDocType == null ? null : eDocType.getSchema ();
  }
660960
public void xmlns(Map<String, String> definition) {
        Assert.notNull(namespaceHandlerResolver, "You cannot define a Spring namespace without a [namespaceHandlerResolver] set");
        if (definition.isEmpty()) {
            return;
        }

        for (Map.Entry<String, String> entry : definition.entrySet()) {
            String namespace = entry.getKey();
            String uri = entry.getValue() == null ? null : entry.getValue();

            Assert.notNull(uri, "Namespace definition cannot supply a null URI");

            final NamespaceHandler namespaceHandler = namespaceHandlerResolver.resolve(uri);
            if (namespaceHandler == null) {
                throw new BeanDefinitionParsingException(
                      new Problem("No namespace handler found for URI: " + uri,
                            new Location(readerContext.getResource())));
            }
            namespaceHandlers.put(namespace, namespaceHandler);
            namespaces.put(namespace, uri);
        }
    }
950027
def LookupNamespace(self, prefix):
        
        ret = libxml2mod.xmlTextReaderLookupNamespace(self._o, prefix)
        return ret
1272714
private String parse(DocumentContext document) throws ParseException {
    if (document.namespaceDeclaration() != null) {
      setCurrentNamespace(
        document.namespaceDeclaration().qualifiedIdentifier().value);
    } else {
      setCurrentNamespace("");
    }

    setCurrentImports(document.importDeclarations());
    NamedDataSchema schema = parseNamedType(document.namedTypeDeclaration());
    topLevelSchemas.add(schema);
    return schema.getFullName();
  }
1090520
private static void parseNamespacesForElement(
      XmlPullParser parser, XmlNamespaceDictionary namespaceDictionary)
      throws XmlPullParserException {
    int eventType = parser.getEventType();
    Preconditions.checkState(
        eventType == XmlPullParser.START_TAG,
        "expected start of XML element, but got something else (event type %s)",
        eventType);
    int depth = parser.getDepth();
    int nsStart = parser.getNamespaceCount(depth - 1);
    int nsEnd = parser.getNamespaceCount(depth);
    for (int i = nsStart; i < nsEnd; i++) {
      String namespace = parser.getNamespaceUri(i);
      // if namespace isn't already in our dictionary, add it now
      if (namespaceDictionary.getAliasForUri(namespace) == null) {
        String prefix = parser.getNamespacePrefix(i);
        String originalAlias = prefix == null ? "" : prefix;
        // find an available alias
        String alias = originalAlias;
        int suffix = 1;
        while (namespaceDictionary.getUriForAlias(alias) != null) {
          suffix++;
          alias = originalAlias + suffix;
        }
        namespaceDictionary.set(alias, namespace);
      }
    }
  }
1200157
@Override
	public String getAttributeValue(String namespace, String name) {
		for (int i = (attributeCount * 4) - 4; i >= 0; i -= 4) {
			if (attributes[i + 2].equals(name) && (namespace == null || attributes[i].equals(namespace))) {
				return attributes[i + 3];
			}
		}

		return null;
	}
1200146
public <S extends io.sarl.lang.core.Space> S createSpace(SpaceID spaceID,
			Class<? extends SpaceSpecification<S>> spec, Object... creationParams) {
		synchronized (getSpaceRepositoryMutex()) {
			if (!this.spaces.containsKey(spaceID)) {
				return createSpaceInstance(spec, spaceID, true, creationParams);
			}
		}
		return null;
	}
492978
@Override
    public final String getNamespaceURI(String prefix)
    {
        if (prefix.length() == 0) { //default NS
            return mDefaultNsURI;
        }
        if (mNsMapping != null) {
            String uri = mNsMapping.findUriByPrefix(prefix);
            if (uri != null) {
                return uri;
            }
        }
        return (mRootNsContext != null) ?
            mRootNsContext.getNamespaceURI(prefix) : null;
    }
127050
public static String getPrefix(String namespaceString)
    {
        Namespace namespace = toNamespace(namespaceString);

        return namespace != null ? namespace.getType() : null;
    }
176000
public static String getNamespace(JsonNode node) {
		JsonNode nodeNs = obj(node).get(ID_NAMESPACE);
		return (nodeNs != null) ? nodeNs.asText() : null;
	}
126376
protected String getPrefix(String namespace, boolean generatePrefix, boolean nonEmpty) {
		// assert namespace != null;
		if (!namesInterned) {
			// when String is interned we can do much faster namespace stack
			// lookups ...
			namespace = namespace.intern();
		} else if (checkNamesInterned) {
			checkInterning(namespace);
			// assert namespace != namespace.intern();
		}
		if (namespace == null) {
			throw new IllegalArgumentException("namespace must be not null" + getLocation());
		} else if (namespace.length() == 0) {
			throw new IllegalArgumentException("default namespace cannot have prefix" + getLocation());
		}

		// first check if namespace is already in scope
		for (int i = namespaceEnd - 1; i >= 0; --i) {
			if (namespace == namespaceUri[i]) {
				final String prefix = namespacePrefix[i];
				if (nonEmpty && prefix.length() == 0)
					continue;
				// now check that prefix is still in scope
				for (int p = namespaceEnd - 1; p > i; --p) {
					if (prefix == namespacePrefix[p])
						continue; // too bad - prefix is redeclared with
									// different namespace
				}
				return prefix;
			}
		}

		// so not found it ...
		if (!generatePrefix) {
			return null;
		}
		return generatePrefix(namespace);
	}
1079427
static public Namespace gatherNamespaces(Document doc) {
   	NamespaceGatherer gatherer=new NamespaceGatherer();	
   	u.forAllStatementOrBundle(doc.getStatementOrBundle(), 
   	                          gatherer);
   	
   	Namespace ns=gatherer.getNamespace();
   	return ns;
    }
1012537
private Schema getXmlSchema10() throws SAXException {
        final SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
        // Use local copies of schemas rather than resolving from the net. It's faster, and less prone to errors.
        final Source[] schemaFiles = {
                new StreamSource(this.getClass().getClassLoader().getResourceAsStream("spdx.xsd")),
                new StreamSource(this.getClass().getClassLoader().getResourceAsStream("bom-1.0.xsd"))
        };
        return schemaFactory.newSchema(schemaFiles);
    }
1292540
public static void setNamespace(Element element, String namespace,
            String schemaLocation) {
        element.setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI,
                XMLConstants.XMLNS_ATTRIBUTE, namespace);
        element.setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, XMLNS_XSI,
                XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI);
        element.setAttributeNS(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,
                XSI_SCHEMA_LOCATION, schemaLocation);
    }
344958
public static Node selectSingleNode(Node node, String xpathQuery, Map<String, String> namespaceUris) {
        XPath xpath = DocumentHelper.createXPath(xpathQuery);
        xpath.setNamespaceURIs(namespaceUris);

        return xpath.selectSingleNode(node);
    }
85542
public String getNameSpace() {
        if (nameSpace == null) {
            nameSpace = new StringBuilder().append(catalog).append(".").append(table).toString();
        }
        return nameSpace;

    }
642101
public String getNamespaceURI(String prefix) {
		List<NamespaceDeclaration> nsDecls = getNamespaceDeclarations();
		for (int i = 0; i < nsDecls.size(); i++) {
			NamespaceDeclaration nsDecl = nsDecls.get(i);
			if (nsDecl.prefix.equals(prefix)) {
				return nsDecl.namespaceURI;
			}
		}
		return null;
	}