public static void CopyTo(this IXmlNode source, IXmlNode target) { using (var reader = source.ReadSubtree()) { if (!reader.Read()) return; using (var writer = target.WriteAttributes()) writer.WriteAttributes(reader, false); if (!reader.Read()) return; using (var writer = target.WriteChildren()) do writer.WriteNode(reader, false); while (!(reader.EOF || reader.NodeType == XmlNodeType.EndElement)); } }
public static void CopyTo(this IXmlNode source, IXmlNode target) { using (var reader = source.ReadSubtree()) { if (!reader.Read()) { return; } using (var writer = target.WriteAttributes()) writer.WriteAttributes(reader, false); if (!reader.Read()) { return; } using (var writer = target.WriteChildren()) do { writer.WriteNode(reader, false); }while (!(reader.EOF || reader.NodeType == XmlNodeType.EndElement)); } }
public XmlWriter WriteChildren() { return(node.WriteChildren()); }