element_name

Function element_name 

Source
pub fn element_name<'input, E>(
    child: &Node<'input, 'input>,
    errors: &mut Vec<E>,
) -> Option<&'input str>
where E: From<ParseError>,
Expand description

Used when iterating over node children and you are only expecting elements.

For each element, return it’s name

For all other comments, pi & text raise an error.

§Example:

for child in element.children() {
    let Some(name) = element_name(&child, errors) else {
        continue;
    };

    match name {
        "..." =>
            do_somthing(),

        _ =>
            unexpected_element(child, errors),
    }
}