Selecting the grammar mode
The grammar mode allows you to use only a restricted set of expressions, in either XPath or ESQL, and checks whether the syntax you have entered is valid.
About this task
- Read-only path field
- Read-write path field
- Expression field
If you use XPath syntax, and the expressions are not supported for the property you are using, the syntax is rejected during the validation process.
ESQL and XPath have similar restrictions on the syntax that is permitted for the first two of these field types. There are restrictions to the expression fields as well, but as this type of field supports general expressions that can be used in either language, the range of syntax available is greater than in the first two.
IBM App Connect Enterprise uses code assistance in the grammar management of XPath 1.0 to validate the syntax of expressions you enter. This assistance is always available, regardless of the grammar mode you are using.
By default, you are operating in the restricted grammar mode.
Code assistance enables you to construct syntactically correct expressions but it does not validate those expressions. Validation is performed by property editors in which such expressions are entered.
If you attempt to use an expression that is not valid, the property editor marks it as such, either from a syntax or schema validation perspective.
You receive error or warning messages depending on the preference choices you set in Windows>Preferences>Broker Development>XPath>Validation .
If, under the above validation settings, particular checks are to be marked as errors, error markers are shown in the problems viewer. This behavior results in a message flow being marked as broken, and it cannot then be imported into, or compiled in, a deployable BAR file using the BAR editor.
If you want to use the appropriate unrestricted grammar to input a specific field type, property editors do not force restricted forms of ESQL or XPath 1.0 expressions for such fields that expect them. Instead, you can enter the full range of syntax in the context of the field category concerned, namely, path or general expression, without the validation checks being applied. This means that if you need to, you can deploy the full range of syntax supported by the ESQL or XPath 1.0 runtime environment. Note, however, that such expressions might not be in a form that can be converted to the other language.
To use unrestricted grammar, carry out the following procedure:
Procedure
- Click Integration Development. and expand
- Expand XPath and click Grammar.
- Clear the Use XPath and ESQL equivalent grammar check box.
What to do next
Note that expressions are still checked for valid syntax appropriate in the context of the field type, but you can now use the full range of grammar supported by the runtime environment.