internal static void ParseStringToParameters(string content, ParameterList parameterlist, out SXL.XDocument xdoc) { var lo = new System.Xml.Linq.LoadOptions(); xdoc = System.Xml.Linq.XDocument.Parse(content, lo); var root = xdoc.Root; var fault_el = root.Element("fault"); if (fault_el != null) { var f = Fault.ParseXml(fault_el); string msg = string.Format("XMLRPC FAULT [{0}]: \"{1}\"", f.FaultCode, f.FaultString); var exc = new XmlRpcException(msg); exc.Fault = f; throw exc; } var params_el = root.GetElement("params"); var param_els = params_el.Elements("param").ToList(); foreach (var param_el in param_els) { var value_el = param_el.GetElement("value"); var val = XmlRpc.Value.ParseXml(value_el); parameterlist.Add(val); } }
internal static void ParseStringToParameters(string content, ParameterList parameterlist, out SXL.XDocument xdoc) { var lo = new System.Xml.Linq.LoadOptions(); xdoc = System.Xml.Linq.XDocument.Parse(content,lo); var root = xdoc.Root; var fault_el = root.Element("fault"); if (fault_el != null) { var f = Fault.ParseXml(fault_el); string msg = string.Format("XMLRPC FAULT [{0}]: \"{1}\"", f.FaultCode, f.FaultString); var exc = new XmlRpcException(msg); exc.Fault = f; throw exc; } var params_el = root.GetElement("params"); var param_els = params_el.Elements("param").ToList(); foreach (var param_el in param_els) { var value_el = param_el.GetElement("value"); var val = XmlRpc.Value.ParseXml(value_el); parameterlist.Add(val); } }
public static XDocument ParseXml(string xml, LoadOption options) => XDocument.Parse(xml, options);