Consider a case where a template XML is used to produce several other XMLs with different modifications; it seems that at this moment this requires the template to be parsed as many times as the number of desired target XMLs, because Package doesn't implement Clone and cloneing a Document merely copies the references to the parent Package, which doesn't provide a fresh copy of the parsed structure. Having to parse the same file several times is pretty inefficient - cloning Packages would be much faster.
I tried to #[derive(Clone)] for Package myself, but I encountered an issue: typed_arena::Arena isn't Cloneable either. Is there any way around this?
Consider a case where a template XML is used to produce several other XMLs with different modifications; it seems that at this moment this requires the template to be parsed as many times as the number of desired target XMLs, because
Packagedoesn't implementCloneandcloneing aDocumentmerely copies the references to the parentPackage, which doesn't provide a fresh copy of the parsed structure. Having to parse the same file several times is pretty inefficient - cloningPackages would be much faster.I tried to
#[derive(Clone)]forPackagemyself, but I encountered an issue:typed_arena::Arenaisn'tCloneable either. Is there any way around this?