Skip to main content

Namespaces

Trait Namespaces 

Source
pub trait Namespaces {
    // Required method
    fn namespace_uri(&self, prefix: &str) -> Option<String>;

    // Provided method
    fn default_element_namespace(&self) -> Option<String> { ... }
}
Expand description

The statically known namespaces of an expression: what its prefixes are bound to.

The xml prefix is always bound to XML_NAMESPACE by the parser and is never looked up here.

Required Methods§

Source

fn namespace_uri(&self, prefix: &str) -> Option<String>

The namespace URI bound to a (non-empty) prefix, or None when it is not declared.

Provided Methods§

Source

fn default_element_namespace(&self) -> Option<String>

The default namespace for unprefixed element and type names (XSLT’s xpath-default-namespace); None, the default, puts them in no namespace.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§