| 1090 | } |
| 1091 | |
| 1092 | fn is_true(&self, context: &Context, mathml: Element) -> Result<bool> { |
| 1093 | // return true if there is no condition or if the condition evaluates to true |
| 1094 | return Ok( |
| 1095 | match self.evaluate(context, mathml)? { |
| 1096 | Value::Boolean(b) => b, |
| 1097 | Value::Nodeset(nodes) => nodes.size() > 0, |
| 1098 | _ => false, |
| 1099 | } |
| 1100 | ) |
| 1101 | } |
| 1102 | |
| 1103 | pub fn replace<'c, 's:'c, 'm:'c, T:TreeOrString<'c, 'm, T>>(&self, rules_with_context: &'r mut SpeechRulesWithContext<'c, 's,'m>, mathml: Element<'c>) -> Result<T> { |
| 1104 | if self.rc.string == "process-intent(.)" { |