Function sauron::prelude::element_ns[]

pub fn element_ns<NS, TAG, ATT, VAL>(
    namespace: Option<NS>,
    tag: TAG,
    attrs: Vec<Attribute<NS, ATT, VAL>, Global>,
    children: Vec<Node<NS, TAG, ATT, VAL>, Global>,
    self_closing: bool
) -> Node<NS, TAG, ATT, VAL> where
    NS: PartialEq<NS> + Clone + Debug,
    TAG: PartialEq<TAG> + Clone + Debug,
    ATT: PartialEq<ATT> + Clone + Debug,
    VAL: PartialEq<VAL> + 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
     );