Edit

Share via


XPathTypedValue Class

Definition

Implements the object returned by certain property values of the EmailSubmitConnection and FileSubmitConnection classes to get and set those values.

public ref class XPathTypedValue abstract
public abstract class XPathTypedValue
type XPathTypedValue = class
Public MustInherit Class XPathTypedValue
Inheritance
XPathTypedValue

Remarks

An XPathTypedValue object is returned by the following members of the EmailSubmitConnection class to get or set their values:

An XPathTypedValue object is returned by the Filename property of the EmailSubmitConnection class to get or set its value.

To read or set these properties, you must use the properties and methods of the XPathTypedValue class.

You can set the value of a property that returns an XPathTypedValue object by specifying either a literal string or by specifying an XPath expression. Using an XPath expression allows you to set the property by retrieving the value from a field on that form (or some other node in the form's data sources). Additionally, you can use XPath operators and functions to perform other operations on the retrieved data.

To set the value of a property as a literal string, you use the SetStringValue(String) method of the XPathTypedValue class.

The following example shows how to set the value of the To property of the EmailSubmitConnection class by specifying an e-mail address as a literal string using the SetStringValue method.

// Get the e-mail submit data connection configured for the form.
EmailSubmitConnection mySubmit = (EmailSubmitConnection)
   (this.DataConnections["Email Submit"]);

// Set To property to literal string value.
mySubmit.To.SetStringValue("someone@example.com");

// Submit form.
mySubmit.Execute();
' Get the e-mail submit data connection configured for the form.
Dim mySubmit As EmailSubmitConnection = DirectCast(_
   Me.DataConnections["Email Submit"], EmailSubmitConnection)

' Set To property to literal string value.
mySubmit.To.SetStringValue("someone@example.com")

' Submit form.
mySubmit.Execute()

To set the value of a property as an XPath expression, use the XPath property of the XPathTypedValue class.

The following example shows how to set the value of the To property of the EmailSubmitConnection class, by specifying an e-mail address as an XPath expression that retrieves the value from the ToAddress field on the form using the XPath property.

// Get the e-mail submit data connection configured for the form.
EmailSubmitConnection mySubmit = (EmailSubmitConnection)
   (this.DataConnections["Email Submit"]);

// Set To property to XPath for ToAddress field.
mySubmit.To.XPath = "/my:myFields/my:ToAddress";

// Submit form.
mySubmit.Execute();
' Get the e-mail submit data connection configured for the form.
Dim mySubmit As EmailSubmitConnection = DirectCast(_
   Me.DataConnections["Email Submit"], EmailSubmitConnection)

' Set To property to XPath for ToAddress field.
mySubmit.To = "/my:myFields/my:ToAddress"

' Submit form.
mySubmit.Execute()

To read values of properties returned as XPathTypedValue objects, use the Evaluate() method of the XPathTypedValue class to evaluate an XPath expression and return its result as a string, or use the ToString() method of the XPathTypedValue class to return a literal string.

Constructors

XPathTypedValue()

Properties

XPath

Gets or sets the XPath expression of an XPathTypedValue object.

Methods

Evaluate()

Evaluates the XPath expression defined for an XPathTypedValue object.

SetStringValue(String)

Specifies a literal string for an XPathTypedValue object.

ToString()

Converts the value defined for an XPathTypedValue object to a string.

Applies to