XPathMessageContext XPathMessageContext XPathMessageContext XPathMessageContext Class

Definition

Defines several XPath functions and namespace mappings commonly used when evaluating XPath expressions against SOAP documents.

public ref class XPathMessageContext : System::Xml::Xsl::XsltContext
[System.ComponentModel.TypeConverter(typeof(System.ServiceModel.XamlIntegration.XPathMessageContextTypeConverter))]
public class XPathMessageContext : System.Xml.Xsl.XsltContext
type XPathMessageContext = class
    inherit XsltContext
Public Class XPathMessageContext
Inherits XsltContext
Inheritance
Attributes

Remarks

The XPath engine has full XPath context support and uses the .NET Framework's XsltContext class in the same way that XPathNavigator does to implement this support. XsltContext is an abstract class that allows developers to implement custom XPath function libraries and declare XPath variables. XsltContext is an XmlNamespaceManager and thus also contains the namespace prefix mappings.

The filter engine implements an XsltContext named XPathMessageContext. XPathMessageContext defines custom functions that can be used in XPath expressions and it declares several common namespace prefix mappings. The following table lists the custom functions defined by XPathMessageContext that can be used in XPath expressions.

XPath Function Description
body Returns the SOAP Body node, regardless of SOAP version (1.1. or 1.2).
header Returns the SOAP Header node, regardless of SOAP version (1.1 or 1.2).
correlation-data Takes an input string and returns the value of the associated correlation message property. 'wsc-instanceId' is a reserved string used for context-based correlation.
messageId Returns the value of the WS-Addressing MessageID header.
relatesTo Returns the value of the WS-Addressing RelatesTo header, regardless of version (August2004 or WSA 1.0).
replyTo Returns the value of the WS-Addressing ReplyTo header, regardless of version (August2004 or WSA 1.0).
from Returns the value of the WS-Addressing From header, regardless of version (August2004 or WSA 1.0).
faultTo Returns the value of the WS-Addressing FaultTo header, regardless of version (August2004 or WSA 1.0).
to Returns the value of the WS-Addressing To header if present, else it returns Anonymous.
action Returns the value of the WS-Addressing Action header.
soap-uri Returns the SOAP namespace uri.
headers-with-actor Takes a SOAP Actor uri and returns all headers that contain that actor, regardless of SOAP version (1.1 or 1.2).
actor Returns the SOAP Actor uri of the first child node, regardless of SOAP version (1.1 or 1.2).
is-mandatory Returns whether or not the first child node is mandatory, regardless of SOAP version (1.1 or 1.2).
is-actor-next Returns whether or not the SOAP Actor uri of the first child node assumes the Next role, regardless of SOAP version (1.1 or 1.2).
is-actor-ultimate-receiver Returns whether or not the SOAP Actor uri of the first child node assumes the UltimateReceiver role, regardless of SOAP version (1.1 or 1.2).
date-time Takes an input date string and returns the value converted to a double.
duration Takes an input timespan string and returns the value as a total number of days.
utc-now Returns the value of UtcNow.

The following table lists the default namespaces and namespace prefixes that are declared by XPathMessageContext.

Prefix Namespace
s11 http://schemas.xmlsoap.org/soap/envelope
s12 http://www.w3.org/2003/05/soap-envelope
wsaAugust2004 http://schemas.xmlsoap.org/ws/2004/08/addressing
wsa10 http://www.w3.org/2005/08/addressing
sm http://schemas.microsoft.com/serviceModel/2004/05/xpathfunctions
tempuri http://tempuri.org
ser http://schemas.microsoft.com/2003/10/Serialization

Constructors

XPathMessageContext() XPathMessageContext() XPathMessageContext() XPathMessageContext()

Creates an instance of XPathMessageContext.

XPathMessageContext(NameTable) XPathMessageContext(NameTable) XPathMessageContext(NameTable) XPathMessageContext(NameTable)

Initializes a new instance of the XPathMessageContext class with the specified NameTable.

Properties

DefaultNamespace DefaultNamespace DefaultNamespace DefaultNamespace

Gets the namespace URI for the default namespace.

(Inherited from XmlNamespaceManager)
NameTable NameTable NameTable NameTable

Gets the XmlNameTable associated with this object.

(Inherited from XmlNamespaceManager)
Whitespace Whitespace Whitespace Whitespace

Gets a value that indicates whether to include white space nodes in the output.

Methods

AddNamespace(String, String) AddNamespace(String, String) AddNamespace(String, String) AddNamespace(String, String)

Adds the given namespace to the collection.

(Inherited from XmlNamespaceManager)
CompareDocument(String, String) CompareDocument(String, String) CompareDocument(String, String) CompareDocument(String, String)

Compares the base Uniform Resource Identifiers (URIs) of two documents based upon the order the documents were loaded by the XSLT processor.

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

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

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Returns an enumerator to use to iterate through the namespaces in the XmlNamespaceManager.

(Inherited from XmlNamespaceManager)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetNamespacesInScope(XmlNamespaceScope) GetNamespacesInScope(XmlNamespaceScope) GetNamespacesInScope(XmlNamespaceScope) GetNamespacesInScope(XmlNamespaceScope)

Gets a collection of namespace names keyed by prefix which can be used to enumerate the namespaces currently in scope.

(Inherited from XmlNamespaceManager)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
HasNamespace(String) HasNamespace(String) HasNamespace(String) HasNamespace(String)

Gets a value indicating whether the supplied prefix has a namespace defined for the current pushed scope.

(Inherited from XmlNamespaceManager)
LookupNamespace(String) LookupNamespace(String) LookupNamespace(String) LookupNamespace(String)

Gets the namespace URI for the specified prefix.

(Inherited from XmlNamespaceManager)
LookupPrefix(String) LookupPrefix(String) LookupPrefix(String) LookupPrefix(String)

Finds the prefix declared for the given namespace URI.

(Inherited from XmlNamespaceManager)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
PopScope() PopScope() PopScope() PopScope()

Pops a namespace scope off the stack.

(Inherited from XmlNamespaceManager)
PreserveWhitespace(XPathNavigator) PreserveWhitespace(XPathNavigator) PreserveWhitespace(XPathNavigator) PreserveWhitespace(XPathNavigator)

Evaluates whether to preserve white space nodes or strip them for the given context.

PushScope() PushScope() PushScope() PushScope()

Pushes a namespace scope onto the stack.

(Inherited from XmlNamespaceManager)
RemoveNamespace(String, String) RemoveNamespace(String, String) RemoveNamespace(String, String) RemoveNamespace(String, String)

Removes the given namespace for the given prefix.

(Inherited from XmlNamespaceManager)
ResolveFunction(String, String, XPathResultType[]) ResolveFunction(String, String, XPathResultType[]) ResolveFunction(String, String, XPathResultType[]) ResolveFunction(String, String, XPathResultType[])

Resolves a function reference and returns an IXsltContextFunction that represents the function.

ResolveVariable(String, String) ResolveVariable(String, String) ResolveVariable(String, String) ResolveVariable(String, String)

Resolves a variable reference and returns an IXsltContextVariable that represents the variable.

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

Returns a string that represents the current object.

(Inherited from Object)

Extension Methods

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

Applies to