This topic has not yet been rated - Rate this topic

XPathMessageFilter Class

Represents a query on an XML document defined by an XPath 1.0 expression.

System.Object
  System.ServiceModel.Dispatcher.MessageFilter
    System.ServiceModel.Dispatcher.XPathMessageFilter

Namespace:  System.ServiceModel.Dispatcher
Assembly:  System.ServiceModel (in System.ServiceModel.dll)
public class XPathMessageFilter : MessageFilter, 
	IXmlSerializable

The XPathMessageFilter type exposes the following members.

  Name Description
Public method XPathMessageFilter() Initializes a new instance of the XPathMessageFilter class that matches all well-formed XML documents.
Public method XPathMessageFilter(String) Initializes a new instance of the XPathMessageFilter class using an XPath expression to specify query criteria for the filter.
Public method XPathMessageFilter(XmlReader) Initializes a new instance of the XPathMessageFilter class by reading a streamed XPath with the specified XML reader.
Public method XPathMessageFilter(String, XmlNamespaceManager) Initializes a new instance of the XPathMessageFilter class using the specified XPath expression and namespace manager.
Public method XPathMessageFilter(String, XsltContext) Initializes a new instance of the XPathMessageFilter class using a specified XPath expression and XsltContext.
Public method 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 method 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.
Top
  Name Description
Public property Namespaces Gets the manager that resolves namespace prefixes in the XPath expression that defines the filter.
Public property NodeQuota Gets or sets the maximum number of nodes that should be looked at during filter evaluation.
Public property XPath Gets the XPath expression that defines the query criteria for the filter.
Top
  Name Description
Protected method CreateFilterTable<FilterData> Creates an XPathMessageFilterTable<TFilterData> that has a specified type of data associated with it. (Overrides MessageFilter.CreateFilterTable<FilterData>().)
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method 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. (Overrides MessageFilter.Match(Message).)
Public method Match(MessageBuffer) Determines whether a buffered message satisfies the query criteria of the XPath filter. (Overrides MessageFilter.Match(MessageBuffer).)
Public method Match(SeekableXPathNavigator) Determines whether the XML document provided by the specified optimized XPath navigator satisfies the query criteria of the XPath filter.
Public method Match(XPathNavigator) Evaluates the filter over the specified XPath navigator.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method OnGetSchema Gets the schema for the current XML document.
Protected method OnReadXml Reads the current XML node.
Protected method OnWriteXml Writes a node using writer.
Protected method ReadXPath Initializes the current instance of the XPathMessageFilter with an XPath obtained from a specified XML reader using a specified namespace manager.
Public method Static member StaticGetSchema Gets the type of XML schema used to serialize the XPath filter.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method TrimToSize Compacts the XPath filter, which releases all unused memory.
Protected method WriteXPath Serializes the XPath filter to an XmlWriter.
Public method WriteXPathTo Writes the XML XPath element with a specified XML writer.
Top
  Name Description
Explicit interface implemetation Private method IXmlSerializable.GetSchema An explicit interface implementation that gets the current schema.
Explicit interface implemetation Private method IXmlSerializable.ReadXml An explicit interface implementation that reads the current XML node.
Explicit interface implemetation Private method IXmlSerializable.WriteXml An explicit interface implementation that writes an XML node using writer.
Top

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, seeXML Path Language (XPath) Version 1.0, section 3.5.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ