![]() |
SgmlQL: Operators |
![]()
|
![]()
|
![]()
|
In the explanations below, the syntax of each operator, the types of its arguments, and the results of applying the operator are shown using prototypes. In each prototype, the left side of the arrow shows the type of the result, and the right side shows the syntax and type of arguments. Types are marked in italics; optional keywords and arguments are enclosed within square brackets []; and disjunctions are enclosed within parentheses and separated with a vertical bar ( | ). The elements of the language (keywords, special characters) are in bold, as opposed to the elements of the meta-language which are in roman.
Example
element <-- elementname [ attr: atvset ] [ content: ( element-list | string ) ] In the examples, query indicates an argument of any type.
All the examples below assume that a first query
global $myfile = "myfile-ces.sgml";has been evaluated, and that there exists a file "myfile-ces.sgml".
As in many script languages (Perl, Awk, etc.), operators are flexible as to the type of their arguments. That is, if an argument is not exactly of the required type, the operator will attempt to cast, i.e. convert, the argument to the right type.
The following automatic casts are possible:
pseudo-element -> string
string -> number
string -> boolean
string -> name
boolean->name
pseudo-element -> element
document -> element
etc.Example
3 == "3";TRUE