Szerkesztés

Megosztás a következőn keresztül:


XPathMessageFilter Class

Definition

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
Inheritance
XPathMessageFilter
Implements

Remarks

An XPathMessageFilter uses an XPath expression to determine whether an XML document contains specific elements, attributes, text, or other XML syntactic constructs. 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. 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.

The XML Path Language (XPath) provides a language for addressing parts of an XML document. 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. 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. 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. The XML Path language is fully described in the W3C XML Path Language 1.0 specification.

Numbers in XPath expressions are expressed as double-precision 64-bit values. Therefore XPath expressions that involve testing numbers with many significant digits can return incorrect results due to floating point precision issues. For more information, see XML Path Language (XPath) Version 1.0, section 3.5.

Constructors

XPathMessageFilter()

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

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(String)

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

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(XmlReader)

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

Properties

Namespaces

Gets the manager that resolves namespace prefixes in the XPath expression that defines the filter.

NodeQuota

Gets or sets the maximum number of nodes that should be looked at during filter evaluation.

XPath

Gets the XPath expression that defines the query criteria for the filter.

Methods

CreateFilterTable<FilterData>()

Creates an XPathMessageFilterTable<TFilterData> that has a specified type of data associated with it.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
Match(Message)

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)

Determines whether a buffered message satisfies the query criteria of the XPath filter.

Match(SeekableXPathNavigator)

Determines whether the XML document provided by the specified optimized XPath navigator satisfies the query criteria of the XPath filter.

Match(XPathNavigator)

Evaluates the filter over the specified XPath navigator.

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
OnGetSchema()

Gets the schema for the current XML document.

OnReadXml(XmlReader)

Reads the current XML node.

OnWriteXml(XmlWriter)

Writes a node using writer.

ReadXPath(XmlReader, XmlNamespaceManager)

Initializes the current instance of the XPathMessageFilter with an XPath obtained from a specified XML reader using a specified namespace manager.

StaticGetSchema(XmlSchemaSet)

Gets the type of XML schema used to serialize the XPath filter.

ToString()

Returns a string that represents the current object.

(Inherited from Object)
TrimToSize()

Compacts the XPath filter, which releases all unused memory.

WriteXPath(XmlWriter, IXmlNamespaceResolver)

Serializes the XPath filter to an XmlWriter.

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

Writes the XML XPath element with a specified XML writer.

Explicit Interface Implementations

IXmlSerializable.GetSchema()

An explicit interface implementation that gets the current schema.

IXmlSerializable.ReadXml(XmlReader)

An explicit interface implementation that reads the current XML node.

IXmlSerializable.WriteXml(XmlWriter)

An explicit interface implementation that writes an XML node using writer.

Applies to