Class XPathQueryManager
This class provides an easy-to-use interface for complex (parameterized) XPath queries.
Implements
Inherited Members
Namespace: Mapsui.Providers.Wfs.Xml
Assembly: Mapsui.Nts.dll
Syntax
public class XPathQueryManager : IXPathQueryManager
Constructors
| Edit this page View SourceXPathQueryManager()
Initializes a new instance of the XPathQueryManager class.
Declaration
public XPathQueryManager()
XPathQueryManager(HttpClientUtil)
Initializes a new instance of the XPathQueryManager class.
Declaration
public XPathQueryManager(HttpClientUtil httpClientUtil)
Parameters
Type | Name | Description |
---|---|---|
HttpClientUtil | httpClientUtil | A configured HttpClientUtil instance for performing web requests |
XPathQueryManager(byte[])
Initializes a new instance of the XPathQueryManager class.
Declaration
public XPathQueryManager(byte[] document)
Parameters
Type | Name | Description |
---|---|---|
byte[] | document | A byte array with XML data |
XPathQueryManager(Stream)
Initializes a new instance of the XPathQueryManager class.
Declaration
public XPathQueryManager(Stream documentStream)
Parameters
Type | Name | Description |
---|---|---|
Stream | documentStream | A Stream with XML data |
XPathQueryManager(string)
Initializes a new instance of the XPathQueryManager class.
Declaration
public XPathQueryManager(string fileName)
Parameters
Type | Name | Description |
---|---|---|
string | fileName |
XPathQueryManager(XPathDocument?)
Initializes a new instance of the XPathQueryManager class.
Declaration
public XPathQueryManager(XPathDocument? xPathDoc)
Parameters
Type | Name | Description |
---|---|---|
XPathDocument | xPathDoc | An XmlDocument instance |
Methods
| Edit this page View SourceAddNamespace(string, string)
This method adds a namespace for XPath queries.
Declaration
public void AddNamespace(string prefix, string ns)
Parameters
Type | Name | Description |
---|---|---|
string | prefix | The namespace prefix |
string | ns | The namespace URI |
Clone()
This method returns a clone of the current instance. The cloned instance operates on the same (read-only) XmlDocument instance.
Declaration
public IXPathQueryManager Clone()
Returns
Type | Description |
---|---|
IXPathQueryManager |
Compile(string)
This method compiles an XPath string.
Declaration
public XPathExpression? Compile(string xPath)
Parameters
Type | Name | Description |
---|---|---|
string | xPath | The XPath string |
Returns
Type | Description |
---|---|
XPathExpression | A compiled XPath expression |
GetIterator(XPathExpression?)
This method returns an XPathNodeIterator instance positioned at the nodes the XPath expression addresses.
Declaration
public XPathNodeIterator? GetIterator(XPathExpression? xPath)
Parameters
Type | Name | Description |
---|---|---|
XPathExpression | xPath | The compiled XPath expression |
Returns
Type | Description |
---|---|
XPathNodeIterator |
GetIterator(XPathExpression, DictionaryEntry[])
This method returns an XPathNodeIterator instance positioned at the nodes the XPath expression addresses.
Declaration
public XPathNodeIterator? GetIterator(XPathExpression xPath, DictionaryEntry[] queryParameters)
Parameters
Type | Name | Description |
---|---|---|
XPathExpression | xPath | The compiled XPath expression |
DictionaryEntry[] | queryParameters | Parameters for the compiled XPath expression |
Returns
Type | Description |
---|---|
XPathNodeIterator |
GetValueFromNode(XPathExpression?, DictionaryEntry[]?)
This method returns the value of the first node the XPath expression addresses.
Declaration
public string? GetValueFromNode(XPathExpression? xPath, DictionaryEntry[]? queryParameters = null)
Parameters
Type | Name | Description |
---|---|---|
XPathExpression | xPath | The compiled XPath expression |
DictionaryEntry[] | queryParameters | Parameters for the compiled XPath expression |
Returns
Type | Description |
---|---|
string |
GetValuesFromNodes(XPathExpression)
This method returns a collection of the values of all nodes the XPath expression addresses.
Declaration
public List<string> GetValuesFromNodes(XPathExpression xPath)
Parameters
Type | Name | Description |
---|---|---|
XPathExpression | xPath | The compiled XPath expression |
Returns
Type | Description |
---|---|
List<string> |
GetValuesFromNodes(XPathExpression, DictionaryEntry[])
This method returns a collection of the values of all nodes the XPath expression addresses.
Declaration
public List<string> GetValuesFromNodes(XPathExpression xPath, DictionaryEntry[] queryParameters)
Parameters
Type | Name | Description |
---|---|---|
XPathExpression | xPath | The compiled XPath expression |
DictionaryEntry[] | queryParameters | Parameters for the compiled XPath expression |
Returns
Type | Description |
---|---|
List<string> |
GetXPathQueryManagerInContext(XPathExpression?, DictionaryEntry[]?)
This method returns an instance of XPathQueryManager in the context of the first node the XPath expression addresses.
Declaration
public IXPathQueryManager? GetXPathQueryManagerInContext(XPathExpression? xPath, DictionaryEntry[]? queryParameters = null)
Parameters
Type | Name | Description |
---|---|---|
XPathExpression | xPath | The compiled XPath expression |
DictionaryEntry[] | queryParameters | Parameters for the compiled XPath expression |
Returns
Type | Description |
---|---|
IXPathQueryManager |
InitAsync()
Init Async
Declaration
public Task InitAsync()
Returns
Type | Description |
---|---|
Task | Task |
ResetNamespaces()
This method deletes the current namespace context.
Declaration
public void ResetNamespaces()
SetDocumentToParse(byte[])
Sets a new XML document.
Declaration
public void SetDocumentToParse(byte[] document)
Parameters
Type | Name | Description |
---|---|---|
byte[] | document | A byte array with XML data |
SetDocumentToParse(Stream)
Sets a new XML document.
Declaration
public void SetDocumentToParse(Stream documentStream)
Parameters
Type | Name | Description |
---|---|---|
Stream | documentStream | A Stream with XML data |
SetDocumentToParse(string)
Sets a new XmlDocument
Declaration
public void SetDocumentToParse(string fileName)
Parameters
Type | Name | Description |
---|---|---|
string | fileName |
SetDocumentToParseAsync(HttpClientUtil)
Sets a new XML document.
Declaration
public Task SetDocumentToParseAsync(HttpClientUtil httpClientUtil)
Parameters
Type | Name | Description |
---|---|---|
HttpClientUtil | httpClientUtil | A configured HttpClientUtil instance for performing web requests |
Returns
Type | Description |
---|---|
Task |