Struct toks::prelude::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:
// 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:
// 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:
<furn:table> | | | +- local name | prefix (when resolved gives namespace_url)
Fields
prefix: Option<Atom<PrefixStaticSet>>
ns: Atom<NamespaceStaticSet>
local: Atom<LocalNameStaticSet>
Methods
impl QualName
fn new(
prefix: Option<Atom<PrefixStaticSet>>,
ns: Atom<NamespaceStaticSet>,
local: Atom<LocalNameStaticSet>
) -> QualName
prefix: Option<Atom<PrefixStaticSet>>,
ns: Atom<NamespaceStaticSet>,
local: Atom<LocalNameStaticSet>
) -> QualName