public virtual WithParamAction CreateWithParamAction() { WithParamAction action = new WithParamAction(); action.Compile(this); return(action); }
private void CompileContent(Compiler compiler) { NavigatorInput input = compiler.Input; if (compiler.Recurse()) { 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)) { if (Keywords.Equals(name, input.Atoms.Sort)) { this.sort = true; AddAction(compiler.CreateSortAction()); } else if (Keywords.Equals(name, input.Atoms.WithParam)) { WithParamAction par = compiler.CreateWithParamAction(); CheckDuplicateParams(par.Name); AddAction(par); } else { throw XsltException.UnexpectedKeyword(compiler); } } 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_ApplyTemplates); } }while (compiler.Advance()); compiler.ToParent(); } }
internal void CheckDuplicateParams(XmlQualifiedName name) { if (this.containedActions != null) { foreach (CompiledAction action in this.containedActions) { WithParamAction param = action as WithParamAction; if (param != null && param.Name == name) { throw new XsltException(Res.Xslt_DuplicateParametr, name.ToString()); } } } }
public virtual WithParamAction CreateWithParamAction() { WithParamAction action = new WithParamAction(); action.Compile(this); return action; }