expressionContext Attribute

Microsoft Office InfoPath

Show All Show All

expressionContext Attribute

Specifies the XML Document Object Model (DOM) node on which the expression specified in the expression attribute is rooted.

Type

      xsd:string
    

Remarks

The expressionContext attribute is an optional attribute of the errorCondition element.

It contains a relative XPath expression that identifies the XML DOM node (within the context of the matched XML DOM node) on which the expression is rooted and therefore should be evaluated. The default value is "." This is the same as the matched XML DOM node.

Example

The following is an example of the expressionContext attribute as it is used in the errorCondition element:

    <xsf:customValidation>
   <xsf:errorCondition
      match="/exp:expenseReport"
      expressionContext="exp:reportDate"
      expression="msxsl:string-compare(., ../exp:startDate) < 0 and ../exp:startDate != """
      showErrorOn=".">
      <xsf:errorMessage
         type="modeless"
         shortMessage="The report date occurs before the end of the expense period.">
         The report date occurs before the end of the expense period. Verify that this is correct.
      </xsf:errorMessage> 
   </xsf:errorCondition>
</xsf:customValidation>