public CqXmlDocument(IDomDocument document) { //var root = CreateElement("", "ROOT", ""); CqXmlNode docNode = null; foreach (var child in document.ChildNodes) { var node = new CqXmlNode(this, child); if (node.NodeType == XmlNodeType.DocumentType) { this.AppendChild(node); } else { if (docNode == null) { docNode = new CqXmlNode(this, document); this.AppendChild(docNode); } docNode.AppendChild(node); } } }
public CqXmlDocument(IDomDocument document) { //var root = CreateElement("", "ROOT", ""); CqXmlNode docNode=null; foreach (var child in document.ChildNodes) { var node = new CqXmlNode(this, child); if (node.NodeType == XmlNodeType.DocumentType) { this.AppendChild(node); } else { if (docNode == null) { docNode = new CqXmlNode(this, document); this.AppendChild(docNode); } docNode.AppendChild(node); } } }