diff options
Diffstat (limited to 'src/xml')
-rw-r--r-- | src/xml/element.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/xml/element.rs b/src/xml/element.rs index 647fe90..b778dac 100644 --- a/src/xml/element.rs +++ b/src/xml/element.rs @@ -44,6 +44,17 @@ impl Elements }) } + pub fn get_all_tagged_elements(&self) -> Vec<&Tagged> + { + self.elements + .iter() + .filter_map(|element| match element { + Element::Tagged(tagged_element) => Some(tagged_element), + _ => None, + }) + .collect() + } + pub fn get_all_tagged_elements_with_name(&self, tag_name: &str) -> Vec<&Tagged> { self.elements |