Property Prefix
- Namespace
- SharpVectors.Dom
- Assembly
- SharpVectors.Core.dll
Prefix
Gets or sets the namespace prefix of this node, or null if it is unspecified.
string Prefix { get; set; }
Property Value
- string
The namespace prefix of this node. For example, Prefix is
inkscape
for the element< inkscape:label >
. If there is no prefix, this property returns String.Empty.
Remarks
Note that setting this attribute, when permitted, changes the Name attribute, which holds the qualified name.
Note also that 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 NamespaceURI and LocalName do not change.
For nodes of any type other than Element and Attribute and nodes created with a DOM Level 1 method, such as CreateElement(string) from the IDocument interface, this is always null.
Exceptions
- DomException
INVALID_CHARACTER_ERR: Raised if the specified prefix contains an illegal character.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NAMESPACE_ERR: Raised if the specified Prefix is malformed, if the NamespaceURI of this node is null, if the specified prefix is "xml" and the NamespaceURI of this node is different from https://www.w3.org/XML/1998/namespace, if this node is an attribute and the specified prefix is
xmlns
and the NamespaceURI of this node is different from https://www.w3.org/2000/xmlns/, or if this node is an attribute and theQualifiedName
of this node isxmlns
.