private void createAUPara(string auparas, CommandOutput lst) { string startdatetime = string.Empty; if (lst.NameOfAnalysis == null || lst.NameOfAnalysis.Trim().Length < 1) { lst.NameOfAnalysis = "R-Output";//Parent Node name. 02Aug2012 } if (auparas == null || auparas.Trim().Length < 1) return; string selectnode = "bskyoutput/bskyanalysis/aup"; string AUPara = "<aup>" + auparas.Replace("&", "&").Replace("<", "<").Replace(">", ">") + "</aup>";//single AUPara for all lines XmlDocument xd = null; ///// Creating DOM for generation output /////// string fulldom = "<bskyoutput> <bskyanalysis>" + AUPara + "</bskyanalysis> </bskyoutput>"; xd = new XmlDocument(); xd.LoadXml(fulldom); //// for creating AUPara ////////////// BSkyOutputGenerator bsog = new BSkyOutputGenerator(); int noofaup = xd.SelectNodes(selectnode).Count;// should be 3 for (int k = 1; k <= noofaup; k++) { if (lst.NameOfAnalysis.Equals("R-Output") || lst.NameOfAnalysis.Contains("Command Editor Execution")) { lst.Add(bsog.createAUPara(xd, selectnode + "[" + (1) + "]", "")); } else if (lst.NameOfAnalysis.Equals("Datasets")) { lst.Add(bsog.createAUPara(xd, selectnode + "[" + (1) + "]", "Open Datasets")); } else { lst.Add(bsog.createAUPara(xd, selectnode + "[" + k + "]", startdatetime)); } } }