WriteQualifiedName Method
Collapse the table of content
Expand the table of content

XmlWriter.WriteQualifiedName Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

When overridden in a derived class, writes out the namespace-qualified name. This method looks up the prefix that is in scope for the given namespace.

Namespace:  System.Xml
Assembly:  System.Xml (in System.Xml.dll)

public virtual void WriteQualifiedName(
	string localName,
	string ns
)

Parameters

localName
Type: System.String
The local name to write.
ns
Type: System.String
The namespace URI for the name.

ExceptionCondition
ArgumentException

localName is String.Empty or not a valid name.

NullReferenceException

localName or ns is null.

If ns maps to the current default namespace, no prefix is generated.

When writing attribute values, this method generates a prefix if ns is not found. When writing element content, it throws an exception if ns is not found.

NoteNote:

If a class derived from the XmlWriter does not override this method localName is not checked to be a valid W3C XML name. In such case, before calling this method, the validity of the string can be checked by IsName method.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft