public string ImportXLIFF(string filename, bool addNew = false) { string result = "Successfully imported from XMSBT."; try { XmlDocument xmlDocument = new XmlDocument(); xmlDocument.Load(filename); XmlNamespaceManager ns = new XmlNamespaceManager(xmlDocument.NameTable); ns.AddNamespace("ns", "urn:oasis:names:tc:xliff:document:2.0"); XmlNode xmlRoot = xmlDocument.SelectSingleNode("//ns:file", ns); Dictionary <string, Label> labels = new Dictionary <string, Label>(); foreach (Label lbl in LBL1.Labels) { labels.Add(lbl.Name, lbl); } foreach (XmlNode unit in xmlRoot.SelectNodes("ns:unit", ns)) { string label = unit.Attributes["id"].Value; string targetText; if (unit.SelectSingleNode("//ns:target", ns) == null) { targetText = unit.SelectSingleNode("//ns:source", ns).InnerText; } else { targetText = unit.SelectSingleNode("//ns:target", ns).InnerText; } byte[] str = QA.CleanBeforeImport(targetText); if (labels.ContainsKey(label)) { labels[label].String.Value = str; } } } catch (Exception ex) { result = "Unknown Error - " + ex.Message; } return(result); }