System.Xml.XmlNode.Prefix Property

Gets or sets the namespace prefix of this node.

Syntax

public virtual string Prefix { get; set; }

Value

The prefix of the node, or the empty string if the node has no prefix.

Remarks

Setting this property, when permitted, changes the XmlNode.Name property, which holds the qualified name, on Element and Attribute nodes. Setting this property on node types that cannot have a prefix (such as Text, Comment, EntityReference, CDATA, ProcessingInstruction, Document, and DocumentFragment) has no effect. Changing the prefix of an attribute that is known to have a default value, does not make a new attribute with the default value and the original prefix appear, since the namespace URI and local name do not change.

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0