first commit
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace CRIF.ACTion.Common.Parsers
|
||||
{
|
||||
public interface IResponseParser<T>
|
||||
{
|
||||
T Parse(XElement xElement);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using System.Xml.XPath;
|
||||
|
||||
namespace CRIF.ACTion.Common.Parsers
|
||||
{
|
||||
public static class XElementExtensions
|
||||
{
|
||||
/*
|
||||
Using XPathSelectElement on an XElement starts with the XElement's parent XDocument,
|
||||
unless you convert the XElement itself to an XDocument
|
||||
*/
|
||||
|
||||
public static XElement XElementXPathSelectElement(this XElement node, string expression)
|
||||
{
|
||||
return (new XDocument(node)).XPathSelectElement(expression);
|
||||
}
|
||||
|
||||
public static XElement XElementXPathSelectElement(this XNode node, string expression, IXmlNamespaceResolver resolver)
|
||||
{
|
||||
return (new XDocument(node)).XPathSelectElement(expression, resolver);
|
||||
}
|
||||
|
||||
public static IEnumerable<XElement> XElementXPathSelectElements(this XElement node, string expression)
|
||||
{
|
||||
return (new XDocument(node)).XPathSelectElements(expression);
|
||||
}
|
||||
|
||||
public static IEnumerable<XElement> XElementXPathSelectElements(this XElement node, string expression, IXmlNamespaceResolver resolver)
|
||||
{
|
||||
return (new XDocument(node)).XPathSelectElements(expression, resolver);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user