XPathMessageFilter 构造函数
定义
初始化 XPathMessageFilter 类的新实例。Initializes a new instance of the XPathMessageFilter class.
重载
| XPathMessageFilter() |
初始化与所有格式良好的 XML 文档相匹配的 XPathMessageFilter 类的新实例。Initializes a new instance of the XPathMessageFilter class that matches all well-formed XML documents. |
| XPathMessageFilter(String) |
使用 XPath 表达式初始化 XPathMessageFilter 类的一个新实例以指定筛选器的查询条件。Initializes a new instance of the XPathMessageFilter class using an XPath expression to specify query criteria for the filter. |
| XPathMessageFilter(XmlReader) |
通过使用指定的 XML 读取器读取流式 XPath 来初始化 XPathMessageFilter 类的一个新实例。Initializes a new instance of the XPathMessageFilter class by reading a streamed XPath with the specified XML reader. |
| XPathMessageFilter(String, XmlNamespaceManager) |
使用指定的 XPath 表达式和命名空间管理器初始化 XPathMessageFilter 类的一个新实例。Initializes a new instance of the XPathMessageFilter class using the specified XPath expression and namespace manager. |
| XPathMessageFilter(XmlReader, XmlNamespaceManager) |
通过使用指定的 XML 读取器读取流式 XPath 以及使用指定的命名空间管理器来初始化 XPathMessageFilter 类的一个新实例。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(String, XsltContext) |
使用指定的 XPath 表达式和 XPathMessageFilter 初始化 XsltContext 类的一个新实例。Initializes a new instance of the XPathMessageFilter class using a specified XPath expression and XsltContext. |
| XPathMessageFilter(XmlReader, XsltContext) |
通过使用指定的 XML 读取器读取流式 XPath 以及使用 XPathMessageFilter 解析命名空间、自定义函数和变量来初始化 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()
初始化与所有格式良好的 XML 文档相匹配的 XPathMessageFilter 类的新实例。Initializes a new instance of the XPathMessageFilter class that matches all well-formed XML documents.
public:
XPathMessageFilter();
public XPathMessageFilter ();
Public Sub New ()
注解
使用 XPath 空表达式初始化 XPathMessageFilter 类的新实例。Initializes a new instance of the XPathMessageFilter class with an empty XPath expression. XPath 空表达式始终与格式良好的 XML 文档相匹配,所以所有对象都满足由 XPath 空表达式定义的筛选器的条件。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.
适用于
XPathMessageFilter(String)
使用 XPath 表达式初始化 XPathMessageFilter 类的一个新实例以指定筛选器的查询条件。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)
参数
例外
xpath 为 null。xpath is null.
注解
当没有要管理的命名空间时使用此构造函数。Use this constructor when there are no namespaces to manage.
此构造函数使用默认的 XmlNamespaceManager 初始化分配给 Namespaces 属性的 XPathMessageContext,所以 XPath 表达式可以访问 XPathMessageContext 定义的函数库。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.
适用于
XPathMessageFilter(XmlReader)
通过使用指定的 XML 读取器读取流式 XPath 来初始化 XPathMessageFilter 类的一个新实例。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)
参数
例外
reader 为 null。reader is null.
注解
假设读取器位于序列化 XPathMessageFilter 的开始元素处。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. 当此方法返回时,读取器定位在紧靠序列化 XPathMessageFilter 后面的位置。When this method returns, the reader is positioned immediately after the serialized XPathMessageFilter. 通过解析 XPath 表达式中的所有前缀(当它们绑定到读取器时),构造函数还可以自动初始化命名空间管理器。The constructor also automatically initializes the namespace manager by resolving all prefixes in the XPath expression as they were bound in the reader.
此方法可以访问通过 WriteXPathTo 方法创建的任何 XML。This method can access any XML that can be created by the WriteXPathTo method.
适用于
XPathMessageFilter(String, XmlNamespaceManager)
使用指定的 XPath 表达式和命名空间管理器初始化 XPathMessageFilter 类的一个新实例。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)
参数
- xpath
- String
XPath 1.0 表达式。An XPath 1.0 expression.
- namespaces
- XmlNamespaceManager
一个可解析 XmlNamespaceManager 中任何命名空间前缀的 xpath。An XmlNamespaceManager that resolves any namespace prefixes in xpath.
例外
xpath 为 null。xpath is null.
注解
当 XPath 使用未在 XPathMessageContext 中定义的前缀时,或要使用您自己的 XmlNamespaceManager 时,请使用此构造函数。Use this constructor when XPath uses prefixes not defined in XPathMessageContext, or when you want to use your own XmlNamespaceManager. 可以创建 XPathMessageContext 的实例并将其传递给此方法。An instance of XPathMessageContext can be created and passed to this method.
如果提供给此方法的实例为 XsltContext 实现,则此方法与调用 XPathMessageFilter 构造函数是等效的。If the instances provided to this method are XsltContext implementations, it is equivalent to calling the XPathMessageFilter constructor.
适用于
XPathMessageFilter(XmlReader, XmlNamespaceManager)
通过使用指定的 XML 读取器读取流式 XPath 以及使用指定的命名空间管理器来初始化 XPathMessageFilter 类的一个新实例。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)
参数
- namespaces
- XmlNamespaceManager
一个可解析来自 XmlNamespaceManager 的 XPath 表达式中的任何命名空间前缀的 reader。An XmlNamespaceManager that resolves any namespace prefixes in the XPath expression from reader. 它也可以是可定义自定义函数或变量的 XsltContext。This can also be an XsltContext that defines custom functions or variables.
例外
reader 为 null。reader is null.
reader 未定位在开始元素上。reader is not positioned on the starting element.
找到读取方言属性、命名空间 URI 或重复属性问题。There were problems reading the dialect attribute or namespace URI, or duplicate attributes were found.
- 或 --or-
读取了无效的方言属性:它不是 XPath。An invalid dialect attribute was read: it was not XPath.
注解
当要使用您自己的 XmlReader 以及 XmlNamespaceManager 定义筛选器时,请使用此方法。Use this constructor when you want to use your own XmlReader and XmlNamespaceManager to define the filter.
假设读取器位于序列化 XPathMessageFilter 的开始元素处。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. 当此方法返回时,读取器定位在紧靠序列化 XPathMessageFilter 后面的位置。When this method returns, the reader is positioned immediately after the serialized XPathMessageFilter.
适用于
XPathMessageFilter(String, XsltContext)
使用指定的 XPath 表达式和 XPathMessageFilter 初始化 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(System::String ^ xpath, System::Xml::Xsl::XsltContext ^ namespaces);
public XPathMessageFilter (string xpath, System.Xml.Xsl.XsltContext context);
public XPathMessageFilter (string xpath, System.Xml.Xsl.XsltContext namespaces);
new System.ServiceModel.Dispatcher.XPathMessageFilter : string * System.Xml.Xsl.XsltContext -> System.ServiceModel.Dispatcher.XPathMessageFilter
new System.ServiceModel.Dispatcher.XPathMessageFilter : string * System.Xml.Xsl.XsltContext -> System.ServiceModel.Dispatcher.XPathMessageFilter
Public Sub New (xpath As String, context As XsltContext)
Public Sub New (xpath As String, namespaces As XsltContext)
参数
- xpath
- String
筛选器的 XPath 1.0 表达式。The XPath 1.0 expression for the filter.
- contextnamespaces
- XsltContext
一个可解析 XsltContext 中任何命名空间前缀、自定义函数或变量的 xpath。An XsltContext that resolves any namespace prefixes, custom functions or variables in xpath.
适用于
XPathMessageFilter(XmlReader, XsltContext)
通过使用指定的 XML 读取器读取流式 XPath 以及使用 XPathMessageFilter 解析命名空间、自定义函数和变量来初始化 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 ^ namespaces);
public XPathMessageFilter (System.Xml.XmlReader reader, System.Xml.Xsl.XsltContext context);
public XPathMessageFilter (System.Xml.XmlReader reader, System.Xml.Xsl.XsltContext namespaces);
new System.ServiceModel.Dispatcher.XPathMessageFilter : System.Xml.XmlReader * System.Xml.Xsl.XsltContext -> System.ServiceModel.Dispatcher.XPathMessageFilter
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)
Public Sub New (reader As XmlReader, namespaces As XsltContext)
参数
- contextnamespaces
- XsltContext
一个可解析来自 XsltContext 的 XPath 表达式中的任何命名空间前缀、函数和变量的 reader。An XsltContext that resolves any namespace prefixes, functions, and variables in the XPath expression from reader.
例外
reader 为 null。reader is null.
注解
当要使用您自己的 XmlReader 以及 XmlNamespaceManager 定义筛选器时,请使用此方法。Use this constructor when you want to use your own XmlReader and XmlNamespaceManager to define the filter.
假设读取器位于序列化 XPathMessageFilter 的开始元素处。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. 当此方法返回时,读取器定位在紧靠序列化 XPathMessageFilter 后面的位置。When this method returns, the reader is positioned immediately after the serialized XPathMessageFilter.