XPathMessageFilter XPathMessageFilter XPathMessageFilter XPathMessageFilter Class

定義

表示查詢由 XPath 1.0 運算式定義的 XML 文件。Represents a query on an XML document defined by an XPath 1.0 expression.

public ref class XPathMessageFilter : System::ServiceModel::Dispatcher::MessageFilter, System::Xml::Serialization::IXmlSerializable
public class XPathMessageFilter : System.ServiceModel.Dispatcher.MessageFilter, System.Xml.Serialization.IXmlSerializable
type XPathMessageFilter = class
    inherit MessageFilter
    interface IXmlSerializable
Public Class XPathMessageFilter
Inherits MessageFilter
Implements IXmlSerializable
繼承
XPathMessageFilterXPathMessageFilterXPathMessageFilterXPathMessageFilter
實作

備註

XPathMessageFilter 會使用 XPath 運算式來判斷 XML 文件是否包含特定項目、屬性、文字或其他 XML 語法結構。An XPathMessageFilter uses an XPath expression to determine whether an XML document contains specific elements, attributes, text, or other XML syntactic constructs. 一般而言,應用程式會在端點使用 XPathMessageFilter 來查詢 SOAP 訊息的內容,然後根據查詢的結果採取適當的行動。Typically, an application uses an XPathMessageFilter at an endpoint to query the contents of a SOAP message and then takes the appropriate action based on the results of that query. 例如,佇列處理序可能會使用 XPath 查詢來檢查已知標頭的優先順序項目,以便決定是否要將訊息移到佇列前面。A queuing process, for example, may use an XPath query to check the priority element of a known header to decide whether to move a message to the front of the queue.

XML 路徑語言 (XPath) 提供了 XML 文件之定址部分的語言。The XML Path Language (XPath) provides a language for addressing parts of an XML document. XPath 中的主要語法建構是一個運算式,它會定義如何周遊 XML 文件的邏輯結構,以及如何定址或識別 XPath 資料型別。The primary syntactic construct in XPath is an expression that defines how to traverse the logical structure of an XML document and address or identify an XPath data type. 具體來說,XPath 實作會針對 XML 文件的結構評估運算式,以產生下列四種基本 XPath 資料型別中的其中一種:字串、數字、布林值 (Boolean) 和節點集。Specifically, XPath implementations evaluate an expression against the structure of an XML document to yield one of the four basic XPath data types: strings, numbers, Booleans, and node sets. 它們也支援將 XPath 資料型別轉換為字串、數字或布林資料型別的功能。They also support functions that convert an XPath data type to a string, number, or Boolean data type. 如果方法預期有這三種資料型別的其中一種,運算式評估結果便會隱含地轉換。If a method expects one of these three data types, the result of the expression evaluation is implicitly converted. 請注意,這三種資料型別不能轉換為節點集型別。Note that these three data types cannot be converted to a node-set type. XML 路徑語言會在W3C XML 路徑語言1.0 規格中完整描述。The XML Path language is fully described in the W3C XML Path Language 1.0 specification.

XPath 運算式中的數字會表示成雙精度 64 位元值。Numbers in XPath expressions are expressed as double-precision 64-bit values. 因此,參與測試包含許多有效位數的 XPath 運算式可能會因為浮點精確度的問題,而傳回不正確的結果。Therefore XPath expressions that involve testing numbers with many significant digits can return incorrect results due to floating point precision issues. 如需詳細資訊,請參閱XML 路徑語言(XPath)版本1.0,第3.5 節For more information, see XML Path Language (XPath) Version 1.0, section 3.5.

建構函式

XPathMessageFilter() XPathMessageFilter() XPathMessageFilter() XPathMessageFilter()

初始化比對所有格式正確 XML 文件之 XPathMessageFilter 類別的新執行個體。Initializes a new instance of the XPathMessageFilter class that matches all well-formed XML documents.

XPathMessageFilter(String) XPathMessageFilter(String) XPathMessageFilter(String) XPathMessageFilter(String)

使用 XPath 運算式來指定篩選條件的查詢準則,初始化 XPathMessageFilter 類別的新執行個體。Initializes a new instance of the XPathMessageFilter class using an XPath expression to specify query criteria for the filter.

XPathMessageFilter(String, XmlNamespaceManager) XPathMessageFilter(String, XmlNamespaceManager) XPathMessageFilter(String, XmlNamespaceManager) XPathMessageFilter(String, XmlNamespaceManager)

使用指定的 XPath 運算式和命名空間管理員,初始化 XPathMessageFilter 類別的新執行個體。Initializes a new instance of the XPathMessageFilter class using the specified XPath expression and namespace manager.

XPathMessageFilter(String, XsltContext) XPathMessageFilter(String, XsltContext) XPathMessageFilter(String, XsltContext) XPathMessageFilter(String, XsltContext)

使用指定的 XPath 運算式和 XPathMessageFilter,初始化 XsltContext 類別的新執行個體。Initializes a new instance of the XPathMessageFilter class using a specified XPath expression and XsltContext.

XPathMessageFilter(XmlReader) XPathMessageFilter(XmlReader) XPathMessageFilter(XmlReader) XPathMessageFilter(XmlReader)

藉由透過已指定 XML 讀取器來讀取已經過資料流處理的 XPath,初始化 XPathMessageFilter 類別的新執行個體。Initializes a new instance of the XPathMessageFilter class by reading a streamed XPath with the specified XML reader.

XPathMessageFilter(XmlReader, XmlNamespaceManager) XPathMessageFilter(XmlReader, XmlNamespaceManager) XPathMessageFilter(XmlReader, XmlNamespaceManager) 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(XmlReader, XsltContext) XPathMessageFilter(XmlReader, XsltContext) XPathMessageFilter(XmlReader, 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.

屬性

Namespaces Namespaces Namespaces Namespaces

取得管理員,它會解析定義篩選條件之 XPath 運算式中的命名空間前置詞。Gets the manager that resolves namespace prefixes in the XPath expression that defines the filter.

NodeQuota NodeQuota NodeQuota NodeQuota

取得或設定應在篩選評估期間查看的節點數目上限。Gets or sets the maximum number of nodes that should be looked at during filter evaluation.

XPath XPath XPath XPath

取得定義篩選條件之查詢準則的 XPath 運算式。Gets the XPath expression that defines the query criteria for the filter.

方法

CreateFilterTable<FilterData>() CreateFilterTable<FilterData>() CreateFilterTable<FilterData>() CreateFilterTable<FilterData>()

建立 XPathMessageFilterTable<TFilterData>,這個篩選條件具有與其相關聯的指定資料型別。Creates an XPathMessageFilterTable<TFilterData> that has a specified type of data associated with it.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
Match(Message) Match(Message) Match(Message) Match(Message)

測試指定的訊息是否符合 XPath 篩選條件的準則。Tests whether a specified message satisfies the criteria of the XPath filter. 這種表單不可以存取訊息的本文。This form is not allowed to access the body of the message.

Match(MessageBuffer) Match(MessageBuffer) Match(MessageBuffer) Match(MessageBuffer)

判斷經緩衝處理的訊息是否符合 XPath 篩選條件的查詢準則。Determines whether a buffered message satisfies the query criteria of the XPath filter.

Match(SeekableXPathNavigator) Match(SeekableXPathNavigator) Match(SeekableXPathNavigator) Match(SeekableXPathNavigator)

判斷由已指定最佳化 XPath 導覽所提供的 XML 文件是否符合 XPath 篩選條件的查詢準則。Determines whether the XML document provided by the specified optimized XPath navigator satisfies the query criteria of the XPath filter.

Match(XPathNavigator) Match(XPathNavigator) Match(XPathNavigator) Match(XPathNavigator)

評估已指定 XPath 導覽的篩選。Evaluates the filter over the specified XPath navigator.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
OnGetSchema() OnGetSchema() OnGetSchema() OnGetSchema()

取得目前 XML 文件的結構描述。Gets the schema for the current XML document.

OnReadXml(XmlReader) OnReadXml(XmlReader) OnReadXml(XmlReader) OnReadXml(XmlReader)

讀取目前的 XML 節點。Reads the current XML node.

OnWriteXml(XmlWriter) OnWriteXml(XmlWriter) OnWriteXml(XmlWriter) OnWriteXml(XmlWriter)

使用 writer 寫入節點。Writes a node using writer.

ReadXPath(XmlReader, XmlNamespaceManager) ReadXPath(XmlReader, XmlNamespaceManager) ReadXPath(XmlReader, XmlNamespaceManager) ReadXPath(XmlReader, XmlNamespaceManager)

使用指定的命名空間管理員,從已指定 XML 讀取器取得的 XPath,初始化 XPathMessageFilter 的目前執行個體。Initializes the current instance of the XPathMessageFilter with an XPath obtained from a specified XML reader using a specified namespace manager.

StaticGetSchema(XmlSchemaSet) StaticGetSchema(XmlSchemaSet) StaticGetSchema(XmlSchemaSet) StaticGetSchema(XmlSchemaSet)

取得用於序列化 XPath 篩選條件的 XML 結構描述型別。Gets the type of XML schema used to serialize the XPath filter.

ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)
TrimToSize() TrimToSize() TrimToSize() TrimToSize()

釋放所有未使用的記憶體,以便精簡 XPath 篩選條件。Compacts the XPath filter, which releases all unused memory.

WriteXPath(XmlWriter, IXmlNamespaceResolver) WriteXPath(XmlWriter, IXmlNamespaceResolver) WriteXPath(XmlWriter, IXmlNamespaceResolver) WriteXPath(XmlWriter, IXmlNamespaceResolver)

將 XPath 篩選條件序列化成 XmlWriterSerializes the XPath filter to an XmlWriter.

WriteXPathTo(XmlWriter, String, String, String, Boolean) WriteXPathTo(XmlWriter, String, String, String, Boolean) WriteXPathTo(XmlWriter, String, String, String, Boolean) WriteXPathTo(XmlWriter, String, String, String, Boolean)

使用已指定 XML 寫入器寫入 XML XPath 項目。Writes the XML XPath element with a specified XML writer.

明確介面實作

IXmlSerializable.GetSchema() IXmlSerializable.GetSchema() IXmlSerializable.GetSchema() IXmlSerializable.GetSchema()

取得目前結構描述的明確介面實作。An explicit interface implementation that gets the current schema.

IXmlSerializable.ReadXml(XmlReader) IXmlSerializable.ReadXml(XmlReader) IXmlSerializable.ReadXml(XmlReader) IXmlSerializable.ReadXml(XmlReader)

讀取目前 XML 節點的明確介面實作。An explicit interface implementation that reads the current XML node.

IXmlSerializable.WriteXml(XmlWriter) IXmlSerializable.WriteXml(XmlWriter) IXmlSerializable.WriteXml(XmlWriter) IXmlSerializable.WriteXml(XmlWriter)

使用 writer 寫入 XML 節點的明確介面實作。An explicit interface implementation that writes an XML node using writer.

適用於