pub struct Name { /* private fields */ }
Expand description

Corresponds to attributes localName, namespaceURI, and prefix on the DOM Node interface.

Specification

localName of type DOMString, readonly, introduced in DOM Level 2

Returns the local part of the qualified name of this node. For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is always null.

namespaceURI of type DOMString, readonly, introduced in DOM Level 2

The namespace URI of this node, or null if it is unspecified. This is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope. It is merely the namespace URI given at creation time. For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is always null.

Note: Per the Namespaces in XML Specification an attribute does not inherit its namespace from the element it is attached to. If an attribute is not explicitly given a namespace, it simply has no namespace.

prefix of type DOMString, introduced in DOM Level 2

The namespace prefix of this node, or null if it is unspecified. Note that setting this attribute, when permitted, changes the nodeName attribute, which holds the qualified name, as well as the tagName and name attributes of the Element and Attr interfaces, when applicable. 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_NODE and ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is always null.

Exceptions on setting

  • 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 “http://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 “http://www.w3.org/2000/xmlns/”, or if this node is an attribute and the qualifiedName of this node is “xmlns”.

Implementations

Construct a new Name from the specified namespace URI and qualified name.

Note, errors include a malformed URI, or malformed prefix or local name.

Return the reserved name for CDATA section nodes

Return the reserved name for Comment nodes

Return the reserved name for Document nodes

Return the reserved name for Document nodes

Return the reserved name for Text nodes

Return the reserved name for DocumentType public_id attribute

Return the reserved name for DocumentType system_id attribute

Does this appear to be an xmlns attribute.

Construct a name for an xmlns attribute.

Does this appear to be an id attribute.

Construct a name for an xml:id attribute. ///

Return this name’s namespace URI.

Return this name’s local name.

Return this name’s prefix.

Set this name’s prefix.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.