StaticContextSettings.DeclareNamespace MethodStaticContextSettings.DeclareNamespace MethodStaticContextSettings::DeclareNamespace Method
Declares a namespace prefix and associates it with a namespace URI, adding the
(prefix, URI)
pair to the set of statically known namespaces.
Parameters
- prefix
Type: System.StringSystem.StringSystem::String^
The namespace prefix.
- namespaceUri
Type: System.StringSystem.StringSystem::String^
The namespace URI.
Exceptions
Exception | Condition |
ArgumentNullExceptionArgumentNullExceptionArgumentNullException | prefix is namespaceUrinamespaceUrinamespaceUri. |
ArgumentExceptionArgumentExceptionArgumentException |
prefix is not a valid xs:NCName (other than the empty string) or is "xml" or "xmlns",
or namespaceUri is not a valid xs:anyURI or is the empty string (when prefix is not the empty string) or is
"http://www.w3.org/XML/1998/namespace" .
|
Remarks
If prefix is not the empty string then calling this method is equivalent to the following XQuery declaration:
declare namespace = " ";
If prefix is the empty string, then calling this method is equivalent to the following XQuery declaration:
declare default element namespace " ";
These namespace declarations may be overridden by any namespace declarations made the body of an XQuery program, but take precedence over those specified in NamespacesNamespacesNamespaces.