Muokkaa

Jaa


XPathMessageFilter Constructors

Definition

Initializes a new instance of the XPathMessageFilter class.

Overloads

XPathMessageFilter()

Initializes a new instance of the XPathMessageFilter class that matches all well-formed XML documents.

XPathMessageFilter(String)

Initializes a new instance of the XPathMessageFilter class using an XPath expression to specify query criteria for the filter.

XPathMessageFilter(XmlReader)

Initializes a new instance of the XPathMessageFilter class by reading a streamed XPath with the specified XML reader.

XPathMessageFilter(String, XmlNamespaceManager)

Initializes a new instance of the XPathMessageFilter class using the specified XPath expression and namespace manager.

XPathMessageFilter(String, XsltContext)

Initializes a new instance of the XPathMessageFilter class using a specified XPath expression and XsltContext.

XPathMessageFilter(XmlReader, XmlNamespaceManager)

Initializes a new instance of the XPathMessageFilter class by reading in a streamed XPath with a specified XML reader and using the specified namespace manager.

XPathMessageFilter(XmlReader, XsltContext)

Initializes a new instance of the XPathMessageFilter class by reading a streamed XPath with a specified XML reader and using the XsltContext to resolve namespaces, custom functions, and variables.

XPathMessageFilter()

Initializes a new instance of the XPathMessageFilter class that matches all well-formed XML documents.

public:
 XPathMessageFilter();
public XPathMessageFilter ();
Public Sub New ()

Remarks

Initializes a new instance of the XPathMessageFilter class with an empty XPath expression. An empty XPath expression always matches a well-formed XML document, so all objects satisfy the criteria of a filter defined by an empty XPath expression.

Applies to

XPathMessageFilter(String)

Initializes a new instance of the XPathMessageFilter class using an XPath expression to specify query criteria for the filter.

public:
 XPathMessageFilter(System::String ^ xpath);
public XPathMessageFilter (string xpath);
new System.ServiceModel.Dispatcher.XPathMessageFilter : string -> System.ServiceModel.Dispatcher.XPathMessageFilter
Public Sub New (xpath As String)

Parameters

xpath
String

A String that contains an XPath 1.0 expression.

Exceptions

xpath is null.

Remarks

Use this constructor when there are no namespaces to manage.

This constructor initializes the XmlNamespaceManager assigned to the Namespaces property by using the default XPathMessageContext, so the XPath expression has access to the function library that the XPathMessageContext defines.

Applies to

XPathMessageFilter(XmlReader)

Initializes a new instance of the XPathMessageFilter class by reading a streamed XPath with the specified XML reader.

public:
 XPathMessageFilter(System::Xml::XmlReader ^ reader);
public XPathMessageFilter (System.Xml.XmlReader reader);
new System.ServiceModel.Dispatcher.XPathMessageFilter : System.Xml.XmlReader -> System.ServiceModel.Dispatcher.XPathMessageFilter
Public Sub New (reader As XmlReader)

Parameters

reader
XmlReader

The XmlReader to read the streamed XPath expression.

Exceptions

reader is null.

Remarks

It is assumed that the reader is positioned at the start element of the serialized XPathMessageFilter. The name of the element is not validated before reading. When this method returns, the reader is positioned immediately after the serialized XPathMessageFilter. The constructor also automatically initializes the namespace manager by resolving all prefixes in the XPath expression as they were bound in the reader.

This method can access any XML that can be created by the WriteXPathTo method.

Applies to

XPathMessageFilter(String, XmlNamespaceManager)

Initializes a new instance of the XPathMessageFilter class using the specified XPath expression and namespace manager.

public:
 XPathMessageFilter(System::String ^ xpath, System::Xml::XmlNamespaceManager ^ namespaces);
public XPathMessageFilter (string xpath, System.Xml.XmlNamespaceManager namespaces);
new System.ServiceModel.Dispatcher.XPathMessageFilter : string * System.Xml.XmlNamespaceManager -> System.ServiceModel.Dispatcher.XPathMessageFilter
Public Sub New (xpath As String, namespaces As XmlNamespaceManager)

Parameters

xpath
String

An XPath 1.0 expression.

namespaces
XmlNamespaceManager

An XmlNamespaceManager that resolves any namespace prefixes in xpath.

Exceptions

xpath is null.

Remarks

Use this constructor when XPath uses prefixes not defined in XPathMessageContext, or when you want to use your own XmlNamespaceManager. An instance of XPathMessageContext can be created and passed to this method.

If the instances provided to this method are XsltContext implementations, it is equivalent to calling the XPathMessageFilter constructor.

Applies to

XPathMessageFilter(String, XsltContext)

Initializes a new instance of the XPathMessageFilter class using a specified XPath expression and XsltContext.

public:
 XPathMessageFilter(System::String ^ xpath, System::Xml::Xsl::XsltContext ^ context);
public XPathMessageFilter (string xpath, System.Xml.Xsl.XsltContext context);
new System.ServiceModel.Dispatcher.XPathMessageFilter : string * System.Xml.Xsl.XsltContext -> System.ServiceModel.Dispatcher.XPathMessageFilter
Public Sub New (xpath As String, context As XsltContext)

Parameters

xpath
String

The XPath 1.0 expression for the filter.

context
XsltContext

An XsltContext that resolves any namespace prefixes, custom functions or variables in xpath.

Applies to

XPathMessageFilter(XmlReader, XmlNamespaceManager)

Initializes a new instance of the XPathMessageFilter class by reading in a streamed XPath with a specified XML reader and using the specified namespace manager.

public:
 XPathMessageFilter(System::Xml::XmlReader ^ reader, System::Xml::XmlNamespaceManager ^ namespaces);
public XPathMessageFilter (System.Xml.XmlReader reader, System.Xml.XmlNamespaceManager namespaces);
new System.ServiceModel.Dispatcher.XPathMessageFilter : System.Xml.XmlReader * System.Xml.XmlNamespaceManager -> System.ServiceModel.Dispatcher.XPathMessageFilter
Public Sub New (reader As XmlReader, namespaces As XmlNamespaceManager)

Parameters

reader
XmlReader

The XmlReader to read the streamed XPath expression.

namespaces
XmlNamespaceManager

An XmlNamespaceManager that resolves any namespace prefixes in the XPath expression from reader. This can also be an XsltContext that defines custom functions or variables.

Exceptions

reader is null.

reader is not positioned on the starting element.

There were problems reading the dialect attribute or namespace URI, or duplicate attributes were found.

-or-

An invalid dialect attribute was read: it was not XPath.

Remarks

Use this constructor when you want to use your own XmlReader and XmlNamespaceManager to define the filter.

It is assumed that the reader is positioned at the start element of the serialized XPathMessageFilter. The name of the element is not validated before reading. When this method returns, the reader is positioned immediately after the serialized XPathMessageFilter.

Applies to

XPathMessageFilter(XmlReader, XsltContext)

Initializes a new instance of the XPathMessageFilter class by reading a streamed XPath with a specified XML reader and using the XsltContext to resolve namespaces, custom functions, and variables.

public:
 XPathMessageFilter(System::Xml::XmlReader ^ reader, System::Xml::Xsl::XsltContext ^ context);
public XPathMessageFilter (System.Xml.XmlReader reader, System.Xml.Xsl.XsltContext context);
new System.ServiceModel.Dispatcher.XPathMessageFilter : System.Xml.XmlReader * System.Xml.Xsl.XsltContext -> System.ServiceModel.Dispatcher.XPathMessageFilter
Public Sub New (reader As XmlReader, context As XsltContext)

Parameters

reader
XmlReader

The XmlReader to read the streamed XPath expression.

context
XsltContext

An XsltContext that resolves any namespace prefixes, functions, and variables in the XPath expression from reader.

Exceptions

reader is null.

Remarks

Use this constructor when you want to use your own XmlReader and XmlNamespaceManager to define the filter.

It is assumed that the reader is positioned at the start element of the serialized XPathMessageFilter. The name of the element is not validated before reading. When this method returns, the reader is positioned immediately after the serialized XPathMessageFilter.

Applies to