fallback
The fallback statement provides a set of templates to be used if a particlar enclosing element is not
supported.
Syntax
<fallback> ::= “fallback”
“{”
<block template>+
“}”
Options
None.
Elements
Any block template except <fallback>.
Examples
From an example elsewhere consider the following code
stylesheet {
version "1.1"
proc process-code {
foreach "*" {
switch using "name()" {
when "'aw:include'" {
variable chunkRef "@ref"
call process-code {
with chunkNode "//aw:chunk[@name = $chunkRef]"
with name "$chunkRef"
}
}
otherwise {
value disable-output-escaping "."
}
fallback {
choose {
when "name() = 'aw:include'" {
variable chunkRef "@ref"
call process-code {
with chunkNode "//aw:chunk[@name = $chunkRef]"
with name "$chunkRef"
}
}
otherwise {
value disable-output-escaping "."
}
}
}
}
}
}
}
If the "switch" statement is not available then the "choose" within the "fallback" is run instead.
Errors
Misspelling the keyword.
stylesheet {
version "4.0"
proc process-code {
foreach "*" {
switch using "name()" {
when "'aw:include'" {
variable chunkRef "@ref"
call process-code {
with chunkNode "//aw:chunk[@name = $chunkRef]"
with name "$chunkRef"
}
}
otherwise {
value disable-output-escaping "."
}
falback {
choose {
gives the error (there may also be other consequential errors here)
**** (105) Unexpected symbol "falback" found in "foreach" in line 17
Check spelling, missing expression, bracket or quote?
**** (136) Unmatched brackets in 1
Too many open brackets?
Copyright 2024 Hugh Field-Richards. All Rights Reserved.