XmlQualifiedName Class
Represents an XML qualified name.
Assembly: System.Xml (in System.Xml.dll)
The XmlQualifiedName type exposes the following members.
| Name | Description | |
|---|---|---|
|
XmlQualifiedName() | Initializes a new instance of the XmlQualifiedName class. |
|
XmlQualifiedName(String) | Initializes a new instance of the XmlQualifiedName class with the specified name. |
|
XmlQualifiedName(String, String) | Initializes a new instance of the XmlQualifiedName class with the specified name and namespace. |
| Name | Description | |
|---|---|---|
|
Equals | Determines whether the specified XmlQualifiedName object is equal to the current XmlQualifiedName object. (Overrides Object.Equals(Object).) |
|
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
|
GetHashCode | Returns the hash code for the XmlQualifiedName. (Overrides Object.GetHashCode().) |
|
GetType | Gets the Type of the current instance. (Inherited from Object.) |
|
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
|
ToString() | Returns the string value of the XmlQualifiedName. (Overrides Object.ToString().) |
|
ToString(String, String) | Returns the string value of the XmlQualifiedName. |
| Name | Description | |
|---|---|---|
|
Equality | Compares two XmlQualifiedName objects. |
|
Inequality | Compares two XmlQualifiedName objects. |
An XML qualified name is a namespace qualified local name in the format of namespace:localname.
Because prefixes are only required when XML is persisted or read, they are irrelevant for XmlQualifiedName objects. This class assumes that prefixes are irrelevant. It is the responsibility of the user to ensure the local name does not contain a ":".
For an example using the XmlQualifiedName class, see XmlSchemaAll.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
http://www1.cs.columbia.edu/~lok/csharp/refdocs/System.Xml/types/XmlQualifiedName.html
In particular what I was unable to find until I read through the above linked page is more information about the "Namespace" property.
It sounds like it is suppose to be the namespace URI, but the ToString() and static ToString(name, ns) methods make it seem like it is supposed to be a namespace prefix (alias). The linked page makes it clear that is is supposed to be the namespace URI, and that the string output is for convenience and debugging not actual use in an xml document.
I'm really not sure why the static ToString method exists at all if all it does is return 2 strings concatenated with a ':' in between.
Now a ToString method which takes an XmlNamespaceManager and looks up the prefix for the Namespace would actually be useful.
- 5/19/2010
- mlippert
- 5/20/2010
- Thomas Lee