You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
560 B
37 lines
560 B
using System.Xml;
|
|
|
|
namespace SiteServer.Utils
|
|
{
|
|
public class XmlUtils
|
|
{
|
|
|
|
public static XmlDocument GetXmlDocument(string xmlContent)
|
|
{
|
|
var xmlDocument = new XmlDocument();
|
|
try
|
|
{
|
|
xmlDocument.LoadXml(xmlContent);
|
|
}
|
|
catch
|
|
{
|
|
// ignored
|
|
}
|
|
|
|
return xmlDocument;
|
|
}
|
|
|
|
public static XmlNode GetXmlNode(XmlDocument xmlDocument, string xpath)
|
|
{
|
|
XmlNode node = null;
|
|
try
|
|
{
|
|
node = xmlDocument.SelectSingleNode(xpath);
|
|
}
|
|
catch
|
|
{
|
|
// ignored
|
|
}
|
|
return node;
|
|
}
|
|
}
|
|
}
|