public virtual IfAction CreateIfAction(IfAction.ConditionType type) { IfAction action = new IfAction(type); action.Compile(this); return(action); }
private void CompileConditions(Compiler compiler) { NavigatorInput input = compiler.Input; bool when = false; bool otherwise = false; do { Debug.Trace(input); switch (input.NodeType) { case XPathNodeType.Element: compiler.PushNamespaceScope(); string nspace = input.NamespaceURI; string name = input.LocalName; if (Keywords.Equals(nspace, input.Atoms.XsltNamespace)) { IfAction action = null; if (Keywords.Equals(name, input.Atoms.When) && !otherwise) { action = compiler.CreateIfAction(IfAction.ConditionType.ConditionWhen); when = true; } else if (Keywords.Equals(name, input.Atoms.Otherwise) && !otherwise) { action = compiler.CreateIfAction(IfAction.ConditionType.ConditionOtherwise); otherwise = true; } else { throw XsltException.UnexpectedKeyword(compiler); } AddAction(action); } else { throw XsltException.UnexpectedKeyword(compiler); } compiler.PopScope(); break; case XPathNodeType.Comment: case XPathNodeType.ProcessingInstruction: case XPathNodeType.Whitespace: case XPathNodeType.SignificantWhitespace: break; default: throw new XsltException(Res.Xslt_InvalidContents, Keywords.s_Choose); } }while (compiler.Advance()); if (!when) { throw new XsltException(Res.Xslt_NoWhen); } }
public virtual IfAction CreateIfAction(IfAction.ConditionType type) { IfAction action = new IfAction(type); action.Compile(this); return action; }
public override IfAction CreateIfAction(IfAction.ConditionType type) { IfAction action = new IfActionDbg(type); action.Compile(this); return action; }