This topic has not yet been rated - Rate this topic

XmlQualifiedName Class

Represents an XML qualified name.

System.Object
  System.Xml.XmlQualifiedName

Namespace:  System.Xml
Assembly:  System.Xml (in System.Xml.dll)
[SerializableAttribute]
public class XmlQualifiedName

The XmlQualifiedName type exposes the following members.

  Name Description
Public method Supported by the XNA Framework Supported by Portable Class Library XmlQualifiedName() Initializes a new instance of the XmlQualifiedName class.
Public method Supported by the XNA Framework Supported by Portable Class Library XmlQualifiedName(String) Initializes a new instance of the XmlQualifiedName class with the specified name.
Public method Supported by the XNA Framework Supported by Portable Class Library XmlQualifiedName(String, String) Initializes a new instance of the XmlQualifiedName class with the specified name and namespace.
Top
  Name Description
Public property Supported by the XNA Framework Supported by Portable Class Library IsEmpty Gets a value indicating whether the XmlQualifiedName is empty.
Public property Supported by the XNA Framework Supported by Portable Class Library Name Gets a string representation of the qualified name of the XmlQualifiedName.
Public property Supported by the XNA Framework Supported by Portable Class Library Namespace Gets a string representation of the namespace of the XmlQualifiedName.
Top
  Name Description
Public method Supported by the XNA Framework Supported by Portable Class Library Equals Determines whether the specified XmlQualifiedName object is equal to the current XmlQualifiedName object. (Overrides Object.Equals(Object).)
Protected method Supported by the XNA Framework Supported by Portable Class Library Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method Supported by the XNA Framework Supported by Portable Class Library GetHashCode Returns the hash code for the XmlQualifiedName. (Overrides Object.GetHashCode().)
Public method Supported by the XNA Framework Supported by Portable Class Library GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method Supported by the XNA Framework Supported by Portable Class Library MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Supported by the XNA Framework Supported by Portable Class Library ToString() Returns the string value of the XmlQualifiedName. (Overrides Object.ToString().)
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(String, String) Returns the string value of the XmlQualifiedName.
Top
  Name Description
Public operator Static member Supported by the XNA Framework Supported by Portable Class Library Equality Compares two XmlQualifiedName objects.
Public operator Static member Supported by the XNA Framework Supported by Portable Class Library Inequality Compares two XmlQualifiedName objects.
Top
  Name Description
Public field Static member Supported by the XNA Framework Supported by Portable Class Library Empty Provides an empty XmlQualifiedName.
Top

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.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

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.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
More informative description of XmlQualifiedName Class
See this other description of this class:

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.