717 lines
37 KiB
XML
717 lines
37 KiB
XML
|
<?xml version="1.0" encoding="utf-8"?>
|
||
|
<Type Name="XmlNamespaceManager" FullName="System.Xml.XmlNamespaceManager" FullNameSP="System_Xml_XmlNamespaceManager" Maintainer="ecma">
|
||
|
<TypeSignature Language="ILASM" Value=".class public XmlNamespaceManager extends System.Object implements System.Collections.IEnumerable" />
|
||
|
<TypeSignature Language="C#" Value="public class XmlNamespaceManager : System.Collections.IEnumerable, System.Xml.IXmlNamespaceResolver" />
|
||
|
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit XmlNamespaceManager extends System.Object implements class System.Collections.IEnumerable, class System.Xml.IXmlNamespaceResolver" />
|
||
|
<MemberOfLibrary>XML</MemberOfLibrary>
|
||
|
<AssemblyInfo>
|
||
|
<AssemblyName>System.Xml</AssemblyName>
|
||
|
<AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ]</AssemblyPublicKey>
|
||
|
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
|
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
|
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
|
</AssemblyInfo>
|
||
|
<ThreadingSafetyStatement>All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.</ThreadingSafetyStatement>
|
||
|
<Base>
|
||
|
<BaseTypeName>System.Object</BaseTypeName>
|
||
|
</Base>
|
||
|
<Interfaces>
|
||
|
<Interface>
|
||
|
<InterfaceName>System.Collections.IEnumerable</InterfaceName>
|
||
|
</Interface>
|
||
|
<Interface>
|
||
|
<InterfaceName>System.Xml.IXmlNamespaceResolver</InterfaceName>
|
||
|
</Interface>
|
||
|
</Interfaces>
|
||
|
<Docs>
|
||
|
<remarks>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>For general information about how namespaces are declared and used in XML documents, see <format type="text/html"><a href="682643fc-b848-4e42-8c0d-50deeaeb5f2a">Managing Namespaces in an XML Document</a></format>. </para>
|
||
|
<para>
|
||
|
<see cref="T:System.Xml.XmlNamespaceManager" /> stores prefixes and namespaces as strings. Here's a summary of management and lookup tasks you can perform with this class. For more information and examples, follow the links to the reference page for each method or property.</para>
|
||
|
<para> </para>
|
||
|
<list type="table">
|
||
|
<listheader>
|
||
|
<item>
|
||
|
<term>
|
||
|
<para>To</para>
|
||
|
</term>
|
||
|
<description>
|
||
|
<para>Use</para>
|
||
|
</description>
|
||
|
</item>
|
||
|
</listheader>
|
||
|
<item>
|
||
|
<term>
|
||
|
<para>Add a namespace</para>
|
||
|
</term>
|
||
|
<description>
|
||
|
<para>
|
||
|
<see cref="M:System.Xml.XmlNamespaceManager.AddNamespace(System.String,System.String)" /> method</para>
|
||
|
</description>
|
||
|
</item>
|
||
|
<item>
|
||
|
<term>
|
||
|
<para>Remove a namespace</para>
|
||
|
</term>
|
||
|
<description>
|
||
|
<para>
|
||
|
<see cref="M:System.Xml.XmlNamespaceManager.RemoveNamespace(System.String,System.String)" /> method</para>
|
||
|
</description>
|
||
|
</item>
|
||
|
<item>
|
||
|
<term>
|
||
|
<para>Find the URI for the default namespace</para>
|
||
|
</term>
|
||
|
<description>
|
||
|
<para>
|
||
|
<see cref="P:System.Xml.XmlNamespaceManager.DefaultNamespace" /> property</para>
|
||
|
</description>
|
||
|
</item>
|
||
|
<item>
|
||
|
<term>
|
||
|
<para>Find the URI for a namespace prefix</para>
|
||
|
</term>
|
||
|
<description>
|
||
|
<para>
|
||
|
<see cref="M:System.Xml.XmlNamespaceManager.LookupNamespace(System.String)" /> method</para>
|
||
|
</description>
|
||
|
</item>
|
||
|
<item>
|
||
|
<term>
|
||
|
<para>Find the prefix for a namespace URI</para>
|
||
|
</term>
|
||
|
<description>
|
||
|
<para>
|
||
|
<see cref="M:System.Xml.XmlNamespaceManager.LookupPrefix(System.String)" /> method</para>
|
||
|
</description>
|
||
|
</item>
|
||
|
<item>
|
||
|
<term>
|
||
|
<para>Get a list of namespaces in the current node</para>
|
||
|
</term>
|
||
|
<description>
|
||
|
<para>
|
||
|
<see cref="M:System.Xml.XmlNamespaceManager.GetNamespacesInScope(System.Xml.XmlNamespaceScope)" /> method</para>
|
||
|
</description>
|
||
|
</item>
|
||
|
<item>
|
||
|
<term>
|
||
|
<para>Scope a namespace</para>
|
||
|
</term>
|
||
|
<description>
|
||
|
<para>
|
||
|
<see cref="M:System.Xml.XmlNamespaceManager.PushScope" /> and <see cref="M:System.Xml.XmlNamespaceManager.PopScope" /> methods</para>
|
||
|
</description>
|
||
|
</item>
|
||
|
<item>
|
||
|
<term>
|
||
|
<para>Check whether a prefix is defined in the current scope</para>
|
||
|
</term>
|
||
|
<description>
|
||
|
<para>
|
||
|
<see cref="M:System.Xml.XmlNamespaceManager.HasNamespace(System.String)" /> method</para>
|
||
|
</description>
|
||
|
</item>
|
||
|
<item>
|
||
|
<term>
|
||
|
<para>Get the name table used to look up prefixes and URIs</para>
|
||
|
</term>
|
||
|
<description>
|
||
|
<para>
|
||
|
<see cref="P:System.Xml.XmlNamespaceManager.NameTable" /> property</para>
|
||
|
</description>
|
||
|
</item>
|
||
|
</list>
|
||
|
<para> </para>
|
||
|
<para>To add namespaces to the namespace manager, you create a <see cref="T:System.Xml.XmlNamespaceManager" /> object and then use the <see cref="M:System.Xml.XmlNamespaceManager.AddNamespace(System.String,System.String)" /> method. Default prefix and namespace pairs are automatically added to the namespace manager on creation.</para>
|
||
|
<para>When you create the namespace manager, you can specify a name table from the <see cref="T:System.Xml.XmlReader" />, <see cref="T:System.Xml.Xsl.XsltContext" />, or <see cref="T:System.Xml.XmlDocument" /> class, and then use the <see cref="M:System.Xml.XmlNamespaceManager.AddNamespace(System.String,System.String)" /> method to add the namespaces. </para>
|
||
|
<para>You can supply the <see cref="T:System.Xml.XmlNamespaceManager" /> object as a parameter to the <see cref="Overload:System.Xml.XmlNode.SelectNodes" /> or <see cref="Overload:System.Xml.XmlNode.SelectSingleNode" /> method of the <see cref="T:System.Xml.XmlDocument" /> class to execute XPath query expressions that reference namespace-qualified element and attribute names.</para>
|
||
|
<para>The namespace manager assumes that prefixes and namespaces have already been verified and conform to the <see cref="http://www.w3.org/TR/REC-xml-names/">W3C Namespaces</see> specification. The namespace manager does not perform any validation. </para>
|
||
|
<para>The namespace manager atomizes the strings when they are added by using the <see cref="M:System.Xml.XmlNamespaceManager.AddNamespace(System.String,System.String)" /> method and when a lookup is performed by using the <see cref="M:System.Xml.XmlNamespaceManager.LookupNamespace(System.String)" /> or <see cref="M:System.Xml.XmlNamespaceManager.LookupPrefix(System.String)" /> method. </para>
|
||
|
<para>The namespace manager implements enumeration support in addition to adding and retrieving namespaces. You can loop through the information saved in the namespace manager by using the foreach construct. For example, if you create a namespace manager with the name nsmanager, you can iterate through the table by using foreach (String prefix in nsmanager). </para>
|
||
|
<para>Because the namespace manager provides a string comparison with the prefix and namespaces as objects, there is a performance improvement when using the namespace manager over the direct comparison of a string.</para>
|
||
|
<para>The following code example shows how to bind the prefix xsd with the namespace URI of http://www.w3.org/2001/XMLSchema and add it to the namespace manager:</para>
|
||
|
<code>nsmgr.AddNamespace("xsd", "http://www.w3.org/2001/XMLSchema")</code>
|
||
|
<code>nsmgr.AddNamespace("xsd", "http://www.w3.org/2001/XMLSchema");</code>
|
||
|
<para>You can then find the namespace by using the <see cref="M:System.Xml.XmlNamespaceManager.LookupNamespace(System.String)" /> method:</para>
|
||
|
<code>nsmgr.LookupNamespace("xsd")</code>
|
||
|
<code>nsmgr.LookupNamespace("xsd");</code>
|
||
|
<para>The following example creates an <see cref="T:System.Xml.XmlNamespaceManager" /> by using the name table from an XML reader:</para>
|
||
|
<code>Dim reader As New XmlTextReader("myfile.xml")
|
||
|
Dim nsmanager As New XmlNamespaceManager(reader.NameTable)
|
||
|
nsmanager.AddNamespace("msbooks", "www.microsoft.com/books")
|
||
|
nsmanager.PushScope()
|
||
|
nsmanager.AddNamespace("msstore", "www.microsoft.com/store")
|
||
|
While reader.Read()
|
||
|
Console.WriteLine("Reader Prefix:{0}", reader.Prefix)
|
||
|
Console.WriteLine("XmlNamespaceManager Prefix:{0}",
|
||
|
nsmanager.LookupPrefix(nsmanager.NameTable.Get(reader.NamespaceURI)))
|
||
|
End While</code>
|
||
|
<code>XmlTextReader reader = new XmlTextReader("myfile.xml");
|
||
|
XmlNamespaceManager nsmanager = new XmlNamespaceManager(reader.NameTable);
|
||
|
nsmanager.AddNamespace("msbooks", "www.microsoft.com/books");
|
||
|
nsmanager.PushScope();
|
||
|
nsmanager.AddNamespace("msstore", "www.microsoft.com/store");
|
||
|
while (reader.Read())
|
||
|
{
|
||
|
Console.WriteLine("Reader Prefix:{0}", reader.Prefix);
|
||
|
Console.WriteLine("XmlNamespaceManager Prefix:{0}",
|
||
|
nsmanager.LookupPrefix(nsmanager.NameTable.Get(reader.NamespaceURI)));
|
||
|
}</code>
|
||
|
</remarks>
|
||
|
<summary>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>Resolves, adds, and removes namespaces to a collection and provides scope management for these namespaces. </para>
|
||
|
</summary>
|
||
|
</Docs>
|
||
|
<Members>
|
||
|
<Member MemberName=".ctor">
|
||
|
<MemberSignature Language="ILASM" Value="public rtspecialname specialname instance void .ctor(class System.Xml.XmlNameTable nameTable)" />
|
||
|
<MemberSignature Language="C#" Value="public XmlNamespaceManager (System.Xml.XmlNameTable nameTable);" />
|
||
|
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Xml.XmlNameTable nameTable) cil managed" />
|
||
|
<MemberType>Constructor</MemberType>
|
||
|
<AssemblyInfo>
|
||
|
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
|
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
|
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
|
</AssemblyInfo>
|
||
|
<ReturnValue />
|
||
|
<Parameters>
|
||
|
<Parameter Name="nameTable" Type="System.Xml.XmlNameTable" />
|
||
|
</Parameters>
|
||
|
<Docs>
|
||
|
<exception cref="T:System.ArgumentNullException">
|
||
|
<paramref name="nameTable" /> is <see langword="null" />.</exception>
|
||
|
<remarks>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>The name table is used to look up prefixes and namespaces. An existing name table with pre-atomized strings can be specified in the constructor. There are several advantages in doing so. For example, if the name table of an <see cref="T:System.Xml.XmlReader" /> object is used, after each read, any namespace and prefix strings pushed into the name table can be re-used by <see cref="T:System.Xml.XmlNamespaceManager" />. </para>
|
||
|
<para>For more information on atomized strings, see <see cref="T:System.Xml.XmlNameTable" />.</para>
|
||
|
<block subset="none" type="note">
|
||
|
<para>If you specify an existing name table, any namespaces in the name table are not automatically added to <see cref="T:System.Xml.XmlNamespaceManager" />. You must use <see cref="M:System.Xml.XmlNamespaceManager.AddNamespace(System.String,System.String)" /> and <see cref="M:System.Xml.XmlNamespaceManager.RemoveNamespace(System.String,System.String)" /> to add or remove namespaces.</para>
|
||
|
</block>
|
||
|
</remarks>
|
||
|
<summary>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>Initializes a new instance of the <see cref="T:System.Xml.XmlNamespaceManager" /> class with the specified <see cref="T:System.Xml.XmlNameTable" />.</para>
|
||
|
</summary>
|
||
|
<param name="nameTable">
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Xml.XmlNameTable" /> to use. </param>
|
||
|
</Docs>
|
||
|
<Excluded>0</Excluded>
|
||
|
</Member>
|
||
|
<Member MemberName="AddNamespace">
|
||
|
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual void AddNamespace(string prefix, string uri)" />
|
||
|
<MemberSignature Language="C#" Value="public virtual void AddNamespace (string prefix, string uri);" />
|
||
|
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void AddNamespace(string prefix, string uri) cil managed" />
|
||
|
<MemberType>Method</MemberType>
|
||
|
<AssemblyInfo>
|
||
|
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
|
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
|
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
|
</AssemblyInfo>
|
||
|
<ReturnValue>
|
||
|
<ReturnType>System.Void</ReturnType>
|
||
|
</ReturnValue>
|
||
|
<Parameters>
|
||
|
<Parameter Name="prefix" Type="System.String" />
|
||
|
<Parameter Name="uri" Type="System.String" />
|
||
|
</Parameters>
|
||
|
<Docs>
|
||
|
<exception cref="T:System.ArgumentException">
|
||
|
<paramref name="prefix" /> is "xml" or "xmlns".</exception>
|
||
|
<exception cref="T:System.ArgumentNullException">
|
||
|
<para>
|
||
|
<paramref name="prefix" /> is <see langword="null" />, or <paramref name="uri" /> is <see langword="null" />.</para>
|
||
|
</exception>
|
||
|
<param name="uri">
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />The namespace to add. </param>
|
||
|
<remarks>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>
|
||
|
<see cref="T:System.Xml.XmlNamespaceManager" /> does not check <paramref name="prefix" /> and <paramref name="uri" /> for conformance.</para>
|
||
|
<para>
|
||
|
<see cref="T:System.Xml.XmlReader" /> checks names, including prefixes and namespaces, to ensure they are valid XML names according to the World Wide Web Consortium (W3C) <see cref="http://www.w3.org/TR/REC-xml-names/">Namespaces specification</see>. <see cref="T:System.Xml.XmlNamespaceManager" /> is used internally by <see cref="T:System.Xml.XmlReader" />, so to avoid a duplication of efforts, <see cref="T:System.Xml.XmlNamespaceManager" /> assumes all prefixes and namespaces are valid.</para>
|
||
|
<para>If the prefix and namespace already exist within the current scope, the new prefix and namespace pair will replace the existing prefix/namespace combination. The same prefix and namespace combination can exist across different scopes.</para>
|
||
|
<para>The following prefix/namespace pairs are added by default to the <see cref="T:System.Xml.XmlNamespaceManager" />. They can be determined at any scope.</para>
|
||
|
<list type="table">
|
||
|
<listheader>
|
||
|
<item>
|
||
|
<term>
|
||
|
<para>Prefix </para>
|
||
|
</term>
|
||
|
<description>
|
||
|
<para>Namespace </para>
|
||
|
</description>
|
||
|
</item>
|
||
|
</listheader>
|
||
|
<item>
|
||
|
<term>
|
||
|
<para>xmlns </para>
|
||
|
</term>
|
||
|
<description>
|
||
|
<para>http://www.w3.org/2000/xmlns/ (the xmlns prefix namespace) </para>
|
||
|
</description>
|
||
|
</item>
|
||
|
<item>
|
||
|
<term>
|
||
|
<para>xml </para>
|
||
|
</term>
|
||
|
<description>
|
||
|
<para>http://www.w3.org/XML/1998/namespace (the XML namespace) </para>
|
||
|
</description>
|
||
|
</item>
|
||
|
<item>
|
||
|
<term>
|
||
|
<para>String.Empty </para>
|
||
|
</term>
|
||
|
<description>
|
||
|
<para>String.Empty (the empty namespace). This value can be reassigned a different prefix. For example, xmlns="" defines the default namespace to be the empty namespace </para>
|
||
|
</description>
|
||
|
</item>
|
||
|
</list>
|
||
|
</remarks>
|
||
|
<summary>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>Adds the given namespace to the collection.</para>
|
||
|
</summary>
|
||
|
<param name="prefix">
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />The prefix to associate with the namespace being added. Use String.Empty to add a default namespace.</param>
|
||
|
<param name="uri">
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />The namespace to add. </param>
|
||
|
</Docs>
|
||
|
<Excluded>0</Excluded>
|
||
|
</Member>
|
||
|
<Member MemberName="DefaultNamespace">
|
||
|
<MemberSignature Language="ILASM" Value=".property string DefaultNamespace { public hidebysig virtual specialname string get_DefaultNamespace() }" />
|
||
|
<MemberSignature Language="C#" Value="public virtual string DefaultNamespace { get; }" />
|
||
|
<MemberSignature Language="ILAsm" Value=".property instance string DefaultNamespace" />
|
||
|
<MemberType>Property</MemberType>
|
||
|
<AssemblyInfo>
|
||
|
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
|
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
|
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
|
</AssemblyInfo>
|
||
|
<ReturnValue>
|
||
|
<ReturnType>System.String</ReturnType>
|
||
|
</ReturnValue>
|
||
|
<Parameters />
|
||
|
<Docs>
|
||
|
<value>
|
||
|
<para>A <see cref="T:System.String" qualify="true" /> containing the
|
||
|
namespace URI for the default namespace, or <see cref="F:System.String.Empty" />
|
||
|
if there is no default namespace.</para>
|
||
|
</value>
|
||
|
<remarks>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>This method is equivalent to calling LookupNamespace(String.Empty).</para>
|
||
|
</remarks>
|
||
|
<summary>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>Gets the namespace URI for the default namespace.</para>
|
||
|
</summary>
|
||
|
</Docs>
|
||
|
<Excluded>0</Excluded>
|
||
|
</Member>
|
||
|
<Member MemberName="GetEnumerator">
|
||
|
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual class System.Collections.IEnumerator GetEnumerator()" />
|
||
|
<MemberSignature Language="C#" Value="public virtual System.Collections.IEnumerator GetEnumerator ();" />
|
||
|
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Collections.IEnumerator GetEnumerator() cil managed" />
|
||
|
<MemberType>Method</MemberType>
|
||
|
<AssemblyInfo>
|
||
|
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
|
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
|
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
|
</AssemblyInfo>
|
||
|
<ReturnValue>
|
||
|
<ReturnType>System.Collections.IEnumerator</ReturnType>
|
||
|
</ReturnValue>
|
||
|
<Parameters />
|
||
|
<Docs>
|
||
|
<remarks>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>The following code shows how to use the <see cref="T:System.Collections.IEnumerator" /> to view all the namespace pairs stored in the <see cref="T:System.Xml.XmlNamespaceManager" /> object.</para>
|
||
|
<code>Dim nsEnum As IEnumerator = nsmgr.GetEnumerator()
|
||
|
Do While nsEnum.MoveNext
|
||
|
If nsEnum.Current <> "" Then
|
||
|
MsgBox("xmlns:" + nsEnum.Current + "=" + nsmgr.LookupNamespace(nsEnum.Current))
|
||
|
End If
|
||
|
Loop</code>
|
||
|
</remarks>
|
||
|
<summary>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>Returns an enumerator to use to iterate through the namespaces in the <see cref="T:System.Xml.XmlNamespaceManager" />.</para>
|
||
|
</summary>
|
||
|
<returns>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>An <see cref="T:System.Collections.IEnumerator" /> containing the prefixes stored by the <see cref="T:System.Xml.XmlNamespaceManager" />.</para>
|
||
|
</returns>
|
||
|
</Docs>
|
||
|
<Excluded>0</Excluded>
|
||
|
</Member>
|
||
|
<Member MemberName="GetNamespacesInScope">
|
||
|
<MemberSignature Language="C#" Value="public virtual System.Collections.Generic.IDictionary<string,string> GetNamespacesInScope (System.Xml.XmlNamespaceScope scope);" />
|
||
|
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Collections.Generic.IDictionary`2<string, string> GetNamespacesInScope(valuetype System.Xml.XmlNamespaceScope scope) cil managed" />
|
||
|
<MemberType>Method</MemberType>
|
||
|
<AssemblyInfo>
|
||
|
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
|
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
|
</AssemblyInfo>
|
||
|
<ReturnValue>
|
||
|
<ReturnType>System.Collections.Generic.IDictionary<System.String,System.String></ReturnType>
|
||
|
</ReturnValue>
|
||
|
<Parameters>
|
||
|
<Parameter Name="scope" Type="System.Xml.XmlNamespaceScope" />
|
||
|
</Parameters>
|
||
|
<Docs>
|
||
|
<since version=".NET 2.0" />
|
||
|
<remarks>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>The dictionary consists of a collection of namespace names keyed by prefix. It can be used to enumerate the in-scope namespaces. The dictionary is a disconnected copy of the namespace list. It remains unchanged as the current in-scope namespace list changes.</para>
|
||
|
<para>The following table shows how <see cref="T:System.Xml.XmlNamespaceScope" /> values affect the namespaces returned by the <see cref="M:System.Xml.XmlNamespaceManager.GetNamespacesInScope(System.Xml.XmlNamespaceScope)" /> method.</para>
|
||
|
<list type="table">
|
||
|
<listheader>
|
||
|
<item>
|
||
|
<term>
|
||
|
<para>XmlNamespaceScope value</para>
|
||
|
</term>
|
||
|
<description>
|
||
|
<para>xmlns:xml</para>
|
||
|
</description>
|
||
|
<description>
|
||
|
<para>xmlns:xmlns</para>
|
||
|
</description>
|
||
|
<description>
|
||
|
<para>xmlns=""</para>
|
||
|
</description>
|
||
|
</item>
|
||
|
</listheader>
|
||
|
<item>
|
||
|
<term>
|
||
|
<para>All</para>
|
||
|
</term>
|
||
|
<description>
|
||
|
<para>Yes</para>
|
||
|
</description>
|
||
|
<description>
|
||
|
<para>No</para>
|
||
|
</description>
|
||
|
<description>
|
||
|
<para>No</para>
|
||
|
</description>
|
||
|
</item>
|
||
|
<item>
|
||
|
<term>
|
||
|
<para>ExcludeXml</para>
|
||
|
</term>
|
||
|
<description>
|
||
|
<para>No</para>
|
||
|
</description>
|
||
|
<description>
|
||
|
<para>No</para>
|
||
|
</description>
|
||
|
<description>
|
||
|
<para>No</para>
|
||
|
</description>
|
||
|
</item>
|
||
|
<item>
|
||
|
<term>
|
||
|
<para>Local</para>
|
||
|
</term>
|
||
|
<description>
|
||
|
<para>No</para>
|
||
|
</description>
|
||
|
<description>
|
||
|
<para>No</para>
|
||
|
</description>
|
||
|
<description>
|
||
|
<para>Yes</para>
|
||
|
</description>
|
||
|
</item>
|
||
|
</list>
|
||
|
</remarks>
|
||
|
<summary>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>Gets a collection of namespace names keyed by prefix which can be used to enumerate the namespaces currently in scope.</para>
|
||
|
</summary>
|
||
|
<returns>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>A collection of namespace and prefix pairs currently in scope.</para>
|
||
|
</returns>
|
||
|
<param name="scope">
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />An enumeration value that specifies the type of namespace nodes to return.</param>
|
||
|
</Docs>
|
||
|
</Member>
|
||
|
<Member MemberName="HasNamespace">
|
||
|
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual bool HasNamespace(string prefix)" />
|
||
|
<MemberSignature Language="C#" Value="public virtual bool HasNamespace (string prefix);" />
|
||
|
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool HasNamespace(string prefix) cil managed" />
|
||
|
<MemberType>Method</MemberType>
|
||
|
<AssemblyInfo>
|
||
|
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
|
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
|
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
|
</AssemblyInfo>
|
||
|
<ReturnValue>
|
||
|
<ReturnType>System.Boolean</ReturnType>
|
||
|
</ReturnValue>
|
||
|
<Parameters>
|
||
|
<Parameter Name="prefix" Type="System.String" />
|
||
|
</Parameters>
|
||
|
<Docs>
|
||
|
<remarks>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>To determine whether there is a default empty namespace defined, set <paramref name="prefix" /> to String.Empty. A return value of true indicates that there is a default namespace defined in the current scope; false indicates that no default namespace is defined.</para>
|
||
|
<block subset="none" type="note">
|
||
|
<para>xmlns:x= "" is illegal according to the <see cref="http://www.w3.org/TR/REC-xml-names/">W3C Namespaces</see> recommendation.</para>
|
||
|
</block>
|
||
|
</remarks>
|
||
|
<summary>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>Gets a value indicating whether the supplied prefix has a namespace defined for the current pushed scope.</para>
|
||
|
</summary>
|
||
|
<returns>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>true if there is a namespace defined; otherwise, false.</para>
|
||
|
</returns>
|
||
|
<param name="prefix">
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />The prefix of the namespace you want to find. </param>
|
||
|
</Docs>
|
||
|
<Excluded>0</Excluded>
|
||
|
</Member>
|
||
|
<Member MemberName="LookupNamespace">
|
||
|
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual string LookupNamespace(string prefix)" />
|
||
|
<MemberSignature Language="C#" Value="public virtual string LookupNamespace (string prefix);" />
|
||
|
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string LookupNamespace(string prefix) cil managed" />
|
||
|
<MemberType>Method</MemberType>
|
||
|
<AssemblyInfo>
|
||
|
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
|
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
|
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
|
</AssemblyInfo>
|
||
|
<ReturnValue>
|
||
|
<ReturnType>System.String</ReturnType>
|
||
|
</ReturnValue>
|
||
|
<Parameters>
|
||
|
<Parameter Name="prefix" Type="System.String" />
|
||
|
</Parameters>
|
||
|
<Docs>
|
||
|
<remarks>
|
||
|
<para>
|
||
|
<block subset="none" type="behaviors"> As described above. </block>
|
||
|
</para>
|
||
|
<para>
|
||
|
<block subset="none" type="overrides"> Override this
|
||
|
method to customize the behavior of this method in types derived from
|
||
|
the <see cref="T:System.Xml.XmlNamespaceManager" />
|
||
|
class.
|
||
|
</block>
|
||
|
</para>
|
||
|
</remarks>
|
||
|
<summary>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>Gets the namespace URI for the specified prefix.</para>
|
||
|
</summary>
|
||
|
<returns>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>Returns the namespace URI for <paramref name="prefix" /> or null if there is no mapped namespace. The returned string is atomized.</para>
|
||
|
<para>For more information on atomized strings, see the <see cref="T:System.Xml.XmlNameTable" /> class.</para>
|
||
|
</returns>
|
||
|
<param name="prefix">
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />The prefix whose namespace URI you want to resolve. To match the default namespace, pass String.Empty. </param>
|
||
|
</Docs>
|
||
|
<Excluded>0</Excluded>
|
||
|
</Member>
|
||
|
<Member MemberName="LookupPrefix">
|
||
|
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual string LookupPrefix(string uri)" />
|
||
|
<MemberSignature Language="C#" Value="public virtual string LookupPrefix (string uri);" />
|
||
|
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string LookupPrefix(string uri) cil managed" />
|
||
|
<MemberType>Method</MemberType>
|
||
|
<AssemblyInfo>
|
||
|
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
|
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
|
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
|
</AssemblyInfo>
|
||
|
<ReturnValue>
|
||
|
<ReturnType>System.String</ReturnType>
|
||
|
</ReturnValue>
|
||
|
<Parameters>
|
||
|
<Parameter Name="uri" Type="System.String" />
|
||
|
</Parameters>
|
||
|
<Docs>
|
||
|
<remarks>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>This method finds the mapped prefix by walking the stack (that is, it looks globally). The supplied string must be atomized for the lookup to succeed. In other words, the supplied string object must exist in the namespace manager's name table (<see cref="P:System.Xml.XmlNamespaceManager.NameTable" />).</para>
|
||
|
<para>The returned string is also atomized. For more information on atomized strings, see the <see cref="T:System.Xml.XmlNameTable" /> class.</para>
|
||
|
</remarks>
|
||
|
<summary>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>Finds the prefix declared for the given namespace URI.</para>
|
||
|
</summary>
|
||
|
<returns>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>The matching prefix. If there is no mapped prefix, the method returns String.Empty. If a null value is supplied, then null is returned.</para>
|
||
|
</returns>
|
||
|
<param name="uri">
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />The namespace to resolve for the prefix. </param>
|
||
|
</Docs>
|
||
|
<Excluded>0</Excluded>
|
||
|
</Member>
|
||
|
<Member MemberName="NameTable">
|
||
|
<MemberSignature Language="ILASM" Value=".property class System.Xml.XmlNameTable NameTable { public hidebysig specialname instance class System.Xml.XmlNameTable get_NameTable() }" />
|
||
|
<MemberSignature Language="C#" Value="public virtual System.Xml.XmlNameTable NameTable { get; }" />
|
||
|
<MemberSignature Language="ILAsm" Value=".property instance class System.Xml.XmlNameTable NameTable" />
|
||
|
<MemberType>Property</MemberType>
|
||
|
<AssemblyInfo>
|
||
|
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
|
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
|
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
|
</AssemblyInfo>
|
||
|
<ReturnValue>
|
||
|
<ReturnType>System.Xml.XmlNameTable</ReturnType>
|
||
|
</ReturnValue>
|
||
|
<Parameters />
|
||
|
<Docs>
|
||
|
<value>
|
||
|
<para> The <see cref="T:System.Xml.XmlNameTable" /> used by the current instance.</para>
|
||
|
</value>
|
||
|
<remarks>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>The name table is used to look up prefixes and namespace URIs.</para>
|
||
|
</remarks>
|
||
|
<summary>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>Gets the <see cref="T:System.Xml.XmlNameTable" /> associated with this object.</para>
|
||
|
</summary>
|
||
|
</Docs>
|
||
|
<Excluded>0</Excluded>
|
||
|
</Member>
|
||
|
<Member MemberName="PopScope">
|
||
|
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual bool PopScope()" />
|
||
|
<MemberSignature Language="C#" Value="public virtual bool PopScope ();" />
|
||
|
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool PopScope() cil managed" />
|
||
|
<MemberType>Method</MemberType>
|
||
|
<AssemblyInfo>
|
||
|
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
|
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
|
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
|
</AssemblyInfo>
|
||
|
<ReturnValue>
|
||
|
<ReturnType>System.Boolean</ReturnType>
|
||
|
</ReturnValue>
|
||
|
<Parameters />
|
||
|
<Docs>
|
||
|
<remarks>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>When you call this method, all namespaces which were added to <see cref="T:System.Xml.XmlNamespaceManager" /> (by calling <see cref="M:System.Xml.XmlNamespaceManager.AddNamespace(System.String,System.String)" />) since the last call to <see cref="M:System.Xml.XmlNamespaceManager.PopScope" /> are removed.</para>
|
||
|
</remarks>
|
||
|
<summary>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>Pops a namespace scope off the stack.</para>
|
||
|
</summary>
|
||
|
<returns>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>true if there are namespace scopes left on the stack; false if there are no more namespaces to pop.</para>
|
||
|
</returns>
|
||
|
</Docs>
|
||
|
<Excluded>0</Excluded>
|
||
|
</Member>
|
||
|
<Member MemberName="PushScope">
|
||
|
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual void PushScope()" />
|
||
|
<MemberSignature Language="C#" Value="public virtual void PushScope ();" />
|
||
|
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void PushScope() cil managed" />
|
||
|
<MemberType>Method</MemberType>
|
||
|
<AssemblyInfo>
|
||
|
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
|
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
|
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
|
</AssemblyInfo>
|
||
|
<ReturnValue>
|
||
|
<ReturnType>System.Void</ReturnType>
|
||
|
</ReturnValue>
|
||
|
<Parameters />
|
||
|
<Docs>
|
||
|
<remarks>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>After a call to this method, all namespaces, which are added to <see cref="T:System.Xml.XmlNamespaceManager" /> (by calling <see cref="M:System.Xml.XmlNamespaceManager.AddNamespace(System.String,System.String)" />), belong to the pushed namespace scope.</para>
|
||
|
</remarks>
|
||
|
<summary>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>Pushes a namespace scope onto the stack.</para>
|
||
|
</summary>
|
||
|
</Docs>
|
||
|
<Excluded>0</Excluded>
|
||
|
</Member>
|
||
|
<Member MemberName="RemoveNamespace">
|
||
|
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual void RemoveNamespace(string prefix, string uri)" />
|
||
|
<MemberSignature Language="C#" Value="public virtual void RemoveNamespace (string prefix, string uri);" />
|
||
|
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void RemoveNamespace(string prefix, string uri) cil managed" />
|
||
|
<MemberType>Method</MemberType>
|
||
|
<AssemblyInfo>
|
||
|
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
|
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
|
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
|
</AssemblyInfo>
|
||
|
<ReturnValue>
|
||
|
<ReturnType>System.Void</ReturnType>
|
||
|
</ReturnValue>
|
||
|
<Parameters>
|
||
|
<Parameter Name="prefix" Type="System.String" />
|
||
|
<Parameter Name="uri" Type="System.String" />
|
||
|
</Parameters>
|
||
|
<Docs>
|
||
|
<remarks>
|
||
|
<para>
|
||
|
<block subset="none" type="behaviors"> As described above. </block>
|
||
|
</para>
|
||
|
<para>
|
||
|
<block subset="none" type="default"> The namespace
|
||
|
removed is from the current namespace scope. Namespaces outside the current
|
||
|
scope are ignored. If <paramref name="prefix" /> or <paramref name=" uri" /> does not exist
|
||
|
in the collection, this method simply returns. </block>
|
||
|
</para>
|
||
|
<para>
|
||
|
<block subset="none" type="overrides"> Override this
|
||
|
method to customize the behavior of this method in types derived from
|
||
|
the <see cref="T:System.Xml.XmlNamespaceManager" />
|
||
|
class.
|
||
|
</block>
|
||
|
</para>
|
||
|
</remarks>
|
||
|
<exception cref="T:System.ArgumentNullException">
|
||
|
<paramref name="prefix" /> is <see langword="null" />, or <paramref name="uri" /> is <see langword="null" />.</exception>
|
||
|
<param name="uri">
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />The namespace to remove for the given prefix. The namespace removed is from the current namespace scope. Namespaces outside the current scope are ignored. </param>
|
||
|
<summary>
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
|
<para>Removes the given namespace for the given prefix.</para>
|
||
|
</summary>
|
||
|
<param name="prefix">
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />The prefix for the namespace </param>
|
||
|
<param name="uri">
|
||
|
<attribution license="cc4" from="Microsoft" modified="false" />The namespace to remove for the given prefix. The namespace removed is from the current namespace scope. Namespaces outside the current scope are ignored. </param>
|
||
|
</Docs>
|
||
|
<Excluded>0</Excluded>
|
||
|
</Member>
|
||
|
<Member MemberName="System.Xml.IXmlNamespaceResolver.GetNamespacesInScope">
|
||
|
<MemberSignature Language="C#" Value="System.Collections.IDictionary IXmlNamespaceResolver.GetNamespacesInScope (System.Xml.XmlNamespaceScope scope);" />
|
||
|
<MemberType>Method</MemberType>
|
||
|
<ReturnValue>
|
||
|
<ReturnType>System.Collections.IDictionary</ReturnType>
|
||
|
</ReturnValue>
|
||
|
<Parameters>
|
||
|
<Parameter Name="scope" Type="System.Xml.XmlNamespaceScope" />
|
||
|
</Parameters>
|
||
|
<Docs>
|
||
|
<param name="scope">To be added.</param>
|
||
|
<summary>To be added.</summary>
|
||
|
<returns>To be added.</returns>
|
||
|
<remarks>To be added.</remarks>
|
||
|
</Docs>
|
||
|
<AssemblyInfo>
|
||
|
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
|
</AssemblyInfo>
|
||
|
</Member>
|
||
|
</Members>
|
||
|
<TypeExcluded>0</TypeExcluded>
|
||
|
</Type>
|