This documentation is archived and is not being maintained.

XmlDocument.CreateAttribute Method (String, String)

Creates an XmlAttribute with the specified qualified name and NamespaceURI.

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

public XmlAttribute CreateAttribute (
	string qualifiedName,
	string namespaceURI
)
public XmlAttribute CreateAttribute (
	String qualifiedName, 
	String namespaceURI
)
public function CreateAttribute (
	qualifiedName : String, 
	namespaceURI : String
) : XmlAttribute
Not applicable.

Parameters

qualifiedName

The qualified name of the attribute. If the name contains a colon then the Prefix property will reflect the part of the name preceding the colon and the LocalName property will reflect the part of the name after the colon.

namespaceURI

The namespaceURI of the attribute. If the qualified name includes a prefix of xmlns, then this parameter must be http://www.w3.org/2000/xmlns/.

Return Value

The new XmlAttribute.

The XmlAttribute can be added to an XmlElement using the SetAttributeNode method.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

XNA Framework

Supported in: 1.0
Show: