minidom: Allow passing prefixes alongside a reader

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2023-01-09 13:26:30 +01:00
commit 93174f97ec
No known key found for this signature in database
GPG key ID: DEDA74AEECA9D0F2
2 changed files with 40 additions and 0 deletions

View file

@ -29,6 +29,15 @@ impl TreeBuilder {
}
}
/// Allow setting prefixes stack.
///
/// Useful to provide knowledge of namespaces that would have been declared on parent elements
/// not present in the reader.
pub fn with_prefixes_stack(mut self, prefixes_stack: Vec<Prefixes>) -> Self {
self.prefixes_stack = prefixes_stack;
self
}
/// Stack depth
pub fn depth(&self) -> usize {
self.stack.len()