ApplyTo

Value Description
Type Strings
Default Self
Description ApplyTo specifies the data that the condition operates on. ApplyTo is resolved within the current environment. The valid values for ApplyTo are therefore dependent on the environment configuration, which is different for each rule type.

Literal

With the Literal value in the ApplyTo tag it is possible to specify a literal as data for conditions. This is useful in conjunction with the Exists condition and the SaveAs attribute.

<Conditions>
  <Exists>
    <ApplyTo>Literal: - </ApplyTo>
    <SaveAs>PageName</SaveAs>
    <SaveMode>AppendSeparator</SaveMode>
  </Exists>
  <Exists>
    <ApplyTo>Form.Submit.Field(Name:SWECmd).Value</ApplyTo>
    <SaveAs>PageName</SaveAs>
    <SaveMode>Append</SaveMode>
  </Exists>
</Conditions>

Additional ApplyTo values

Additional ApplyTo values in the ScriptGen section of a HttpParsingRule.

In addition to the possible values LinkName, FormName, FormFieldName, FormFieldValue and TargetFrame in the ScriptGen section of a HttpParsingRule, there are four new possibilities:

CustomUrlName The current name of a custom URL, if used in a function WebPageLink, WebPageSetActionUrl or WebPageQueryParsedUrl.
PostedData The value of (possibly binary) posted data that appears as a parameter to WebPagePostBin and similar functions. The name of a HTTP header, when the function WebHeaderAdd is recorded (1st parameter of this function).
HeaderName The name of a HTTP header, when the function WebHeaderAdd is recorded (1st parameter of this function).
HeaderValue The value of a HTTP header, when the function WebHeaderAdd is recorded (2nd parameter of this function).

Access to forms

Both rules of type HttpParsingRule (ScriptGen section), HttpScriptingRule and StringScriptingRule (Search section) also have convenient access functions for form data according to the following syntax: "Form" [ ".Query" | ".Body" | ".Submit" ]

This allows specifying the form in the query string ("Query") or in the request body ("Body") of the current HTTP request.

The value Submit, which is the default, is automatically equivalent to Query if the HTTP request uses the method GET, and to Body if the HTTP request uses the method POST.

Once a form is specified according to the syntax above, it is possible to extract details about this form:
  • ActionUrl: Specifies the action URL of a form. It is possible to get more details of the action URL.
  • Encoding: Specifies the encoding to be scripted (for example ENCODE_BLANKS)
<ApplyTo>Form.ActionUrl</ApplyTo>
<ApplyTo>Form.ActionUrl.Host</ApplyTo>
<ApplyTo>Form.ActionUrl.Coords</ApplyTo>
<ApplyTo>Form.Query.Encoding</ApplyTo>
<ApplyTo>Form.Body.Encoding</ApplyTo>
<ApplyTo>Form.Submit.Encoding</ApplyTo>

Moreover, it is possible to specify the individual form fields according to the following syntax: ".Field(" ( "Name" | "Value" | "Index" ) ":" Selector ")" "." ( "Name" | "Value" | "Encoding" | "Usage" )

So it is possible to reference a form field by name, value, or index (zero-based), and extract the name, value, encoding, or usage of such a form field. Encoding means one of the following: "ENCODE_FORM". Usage means one of the following: "SUPPRESS", "USE_HTML_VAL", "USE_SCRIPT_VAL".

<ApplyTo>Form.Submit.Field(Name:SWECmd).Value</ApplyTo>
<ApplyTo>Form.Field(Name:sid).Usage</ApplyTo>
<ApplyTo>Form.Field(Name:sid).Encoding</ApplyTo>
<ApplyTo>Form.Field(Index:0).Name</ApplyTo>
<ApplyTo>Form.Field(Index:2).Value</ApplyTo>
<ApplyTo>Form.Field(Value:Submit with GET).Name</ApplyTo>