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
String

包含 XPath 1.0 運算式的 StringA String that contains an XPath 1.0 expression.

例外狀況

xpathnullxpath 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
XmlReader

要讀取經過資料流處理之 XPath 運算式的 XmlReaderThe XmlReader to read the streamed XPath expression.

例外狀況

readernullreader 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

解析 xpath 中任何命名空間前置詞的 XmlNamespaceManagerAn XmlNamespaceManager that resolves any namespace prefixes in xpath.

例外狀況

xpathnullxpath 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)

參數

reader
XmlReader

要讀取經過資料流處理之 XPath 運算式的 XmlReaderThe XmlReader to read the streamed XPath expression.

namespaces
XmlNamespaceManager

解析從 reader 讀取得到之 XPath 運算式中任何命名空間前置詞的 XmlNamespaceManagerAn XmlNamespaceManager that resolves any namespace prefixes in the XPath expression from reader. 這個項目也可以是定義自訂函式或變數的 XsltContextThis can also be an XsltContext that defines custom functions or variables.

例外狀況

readernullreader 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.

備註

當您想要使用自己的 XmlReaderXmlNamespaceManager 來定義篩選條件時,便可使用這個建構函式。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 ^ namespaces);
public XPathMessageFilter (string xpath, System.Xml.Xsl.XsltContext namespaces);
new System.ServiceModel.Dispatcher.XPathMessageFilter : string * System.Xml.Xsl.XsltContext -> System.ServiceModel.Dispatcher.XPathMessageFilter
Public Sub New (xpath As String, namespaces As XsltContext)

參數

xpath
String

篩選條件的 XPath 1.0 運算式。The XPath 1.0 expression for the filter.

context
XsltContext

解析 XsltContext 中任何命名空間前置詞、自訂函式或變數的 xpathAn 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 ^ namespaces);
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
Public Sub New (reader As XmlReader, namespaces As XsltContext)

參數

reader
XmlReader

要讀取經過資料流處理之 XPath 運算式的 XmlReaderThe XmlReader to read the streamed XPath expression.

context
XsltContext

解析從 XsltContext 讀取得到的 XPath 運算式中任何命名空間前置詞、函式和變數的 readerAn XsltContext that resolves any namespace prefixes, functions, and variables in the XPath expression from reader.

例外狀況

readernullreader is null.

備註

當您想要使用自己的 XmlReaderXmlNamespaceManager 來定義篩選條件時,便可使用這個建構函式。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.

適用於