Struct html5ever_ext::QualName []

pub struct QualName {
    pub prefix: Option<Atom<PrefixStaticSet>>,
    pub ns: Atom<NamespaceStaticSet>,
    pub local: Atom<LocalNameStaticSet>,
}

A name with a namespace. Fully qualified name. Used to depict names of tags and attributes.

Used to differentiate between similar XML fragments. For example:

Be careful when using this code, it's not being tested!
// HTML
<table>
  <tr>
    <td>Apples</td>
    <td>Bananas</td>
  </tr>
</table>

// Furniture XML
<table>
  <name>African Coffee Table</name>
  <width>80</width>
  <length>120</length>
</table>

Without XML namespaces, we can't use those two fragments in the same document at the same time. However if we declare a namespace we could instead say:

Be careful when using this code, it's not being tested!
// Furniture XML
<furn:table>
  <furn:name>African Coffee Table</furn:name>
  <furn:width>80</furn:width>
  <furn:length>120</furn:length>
</furn:table>

and bind it to a different name.

For this reason we parse names that contain a colon in the following way:

Be careful when using this code, it's not being tested!
<furn:table>
   |    |
   |    +- local name
   |
 prefix (when resolved gives namespace_url)

Fields

Methods

impl QualName

Trait Implementations

impl Ord for QualName

impl Hash for QualName

impl Clone for QualName

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for QualName

impl PartialEq<QualName> for QualName

impl Debug for QualName

Formats the value using the given formatter.

impl PartialOrd<QualName> for QualName

impl QualNameExt for QualName
[src]

[src]

Is this name effectively local?

[src]

Is this qualified name this local-only name (no prefix, no namespace)

[src]

Is this qualified name on these local-only names (no prefix, no namespace)

[src]

Can this element have children?

[src]

Should an immediate child text node have <, > and & characters escaped? In modern HTML 5, the only common nodes which don't need this are <script> and <style>. In this case, the immediate child text node's content should not contain, say, </script> as this will cause a parse error. Read more

[src]

Can this element's descendant text nodes have leading, trailing and interstitial whitespace collapsed?