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));
            }
        }
Beispiel #3
0
 public XmlWriter WriteChildren()
 {
     return(node.WriteChildren());
 }