Skip to main content

rebuild_text_subtree_with_doc

Function rebuild_text_subtree_with_doc 

Source
pub fn rebuild_text_subtree_with_doc(
    node: &Node,
    convert_spaces: bool,
    doc: Option<&PostDocument>,
) -> Option<NodeData>
Expand description

Same as rebuild_text_subtree, but consults the post-document’s namespace map to resolve elements whose source xmlns="…" carries an empty prefix. add_nodes only emits elements whose tag is prefix:local; without a prefix the element is dropped with a malformed:namespace warning. libxml2 reports an empty Namespace::get_prefix() for the default-namespace branch even when the doc has a ltx: prefix declared elsewhere, so we reverse-lookup the URI in PostDocument::namespaces to recover the canonical prefix.