public void WriteSingleRecord(VufindDoc vfDoc) { vfDoc.SpecialProcessing(); _objXmlWriter = XmlTextWriter.Create(@"E:\import\singleRecords\" + vfDoc.id + ".xml"); _exportDocument = new XmlDocument(); XmlNode decalrationNode = _exportDocument.CreateXmlDeclaration("1.0", "UTF-8", null); _exportDocument.AppendChild(decalrationNode); decalrationNode.WriteTo(_objXmlWriter); _root = _exportDocument.CreateElement("add"); _exportDocument.AppendChild(_root); _objXmlWriter.WriteStartElement("add"); _doc = _exportDocument.CreateElement("doc"); this.AppendVufindDoc(vfDoc); //_doc.WriteTo(_objXmlWriter); //_doc = _exportDocument.CreateElement("doc"); _objXmlWriter.Flush(); _objXmlWriter.Close(); }
public void AppendVufindDoc(VufindDoc vfDoc) { if (vfDoc == null) { return; } _doc = vfDoc.CreateExportXmlNode(); _doc.WriteTo(_objXmlWriter); _doc = _exportDocument.CreateElement("doc"); }