(doc: &Document)
| 402 | |
| 403 | #[allow(dead_code)] |
| 404 | fn trim_doc(doc: &Document) { |
| 405 | for root_child in doc.root().children() { |
| 406 | if let ChildOfRoot::Element(e) = root_child { |
| 407 | trim_element(&e); |
| 408 | } else { |
| 409 | doc.root().remove_child(root_child); // comment or processing instruction |
| 410 | } |
| 411 | }; |
| 412 | } |
| 413 | |
| 414 | /// Not really meant to be public -- used by tests in some packages |
| 415 | pub fn trim_element(e: &Element) { |