Function mt_dom::element_ns[][src]

pub fn element_ns<NS, TAG, ATT, VAL>(
    namespace: Option<NS>,
    tag: TAG,
    attrs: impl IntoIterator<Item = Attribute<NS, ATT, VAL>>,
    children: impl IntoIterator<Item = Node<NS, TAG, ATT, VAL>>,
    self_closing: bool
) -> Node<NS, TAG, ATT, VAL> where
    NS: PartialEq + Clone + Debug,
    TAG: PartialEq + Clone + Debug,
    ATT: PartialEq + Clone + Debug,
    VAL: PartialEq + Clone + Debug
Expand description

create a virtual node with namespace, tag, attrs and children

Example

use mt_dom::{Node,element_ns,attr};

let svg:Node<&'static str, &'static str, &'static str, &'static str> =
    element_ns(
        Some("http://www.w3.org/2000/svg"),
         "svg",
         vec![attr("width","400"), attr("height","400")],
         vec![],
         false
     );