The following is a list of errors that the compiler detects. The error number is not a contiguous set with some numbers ignored, there are historical reasons for this. It is not a complete list as the compiler is being continually updated.
Error detection and recovery is not an exact science and the compiler does its best to report errors. In many cases there are consequential pseuso-errors that arise because of the error recovery process. The first error on the list is usually the genuine one.
In some rare cases the line number associated with the error is not necessarily the line number of the actual error, rather the start line of the block in which the error has occurred.
Note also the line number presented in the error messages may not be accurate for the fragment examples shown because it is taken from a larger piece of source code.
An unrecoverable error of indeterminate type. Should (!) never happen.
File that crexsel is trying to read does not exist. Check that both path and file exists (check correct file extension).
In general this is a permissions problem.
Mostly, the only time that this is detected is after the "stylesheet" keyword at the start of the file. For example, the simplistic source
would give the error
An unexpected symbol was found in a keyword. A general "catch all" for something the compiler does not understand. Usually caused by keyword mis-spelling, and illegal keyword for that syntax or a missing quote.
Similar to the previous error, but gives what should be in the syntax at that point. For example while entering a XML namespace at the start
would give the error (no closing bracket also)
Found a quoted expression when expecting a keyword or bracket.
Produced when a particular value of option is expected. For example the output "method" expects the values "xml", "html" or "text", anything else will cause this error. For example
would give the error
When a symbol has already been declared. For example, only one declaration of "version" can be declared
would give the error
Similar to Error 109 but used when building the symbol table. For example
would give the error
If there is a missing name in a declaration etc. For example
would give the error
This error also occurs when the variable name is a reserved word.
If an XPath variable is used within a block has not been declared. For example
would give the error
A missing keyword that is required by the syntax. For example the source
would give the error
Unlike parameters that can have no default value or (empty) block, variables (constants) must have either the value or block, both of which return a value to assign to the variable. For example
would give the error
This also detects an empty block so that
would give the error
"when" and "if" conditions require an associated test XPath expression. So for example
would give the error
In a variable or parameter declaration it is not valid to have a value declared as well as a block. For example the following
would give the error
When any expressions are missing from the "match" options ("using", "scope" or "priority". For example
would give the error
When declared in a "proc" or "match" block, parameters should be declared as the first child in that block. For example
would give the error
This is a very broad error condition and reports the matching of the \dqp{\{} and \dqp{\}} brackets throughout the stylesheet. Currently it only works at a global level. For example while entering a basic sitemap source file
would give the error
As an aside if there are any keywords, brackets or expressions declared after the closing stylesheet bracket they are ignored.
If a reserved word is used where a QName is expected, for example a proc or a variable name is expected, this will cause an error.
would give the error
Found invalid or null string where there should be expression.
"sort" statement must immediately follow declaration.