상속: VariableAction
예제 #1
0
        public virtual WithParamAction CreateWithParamAction()
        {
            WithParamAction action = new WithParamAction();

            action.Compile(this);
            return(action);
        }
예제 #2
0
        private void CompileContent(Compiler compiler)
        {
            NavigatorInput input = compiler.Input;

            if (compiler.Recurse())
            {
                do
                {
                    switch (input.NodeType)
                    {
                    case XPathNodeType.Element:
                        compiler.PushNamespaceScope();
                        string nspace = input.NamespaceURI;
                        string name   = input.LocalName;

                        if (Ref.Equal(nspace, input.Atoms.UriXsl))
                        {
                            if (Ref.Equal(name, input.Atoms.Sort))
                            {
                                AddAction(compiler.CreateSortAction());
                            }
                            else if (Ref.Equal(name, input.Atoms.WithParam))
                            {
                                WithParamAction par = compiler.CreateWithParamAction();
                                CheckDuplicateParams(par.Name);
                                AddAction(par);
                            }
                            else
                            {
                                throw compiler.UnexpectedKeyword();
                            }
                        }
                        else
                        {
                            throw compiler.UnexpectedKeyword();
                        }
                        compiler.PopScope();
                        break;

                    case XPathNodeType.Comment:
                    case XPathNodeType.ProcessingInstruction:
                    case XPathNodeType.Whitespace:
                    case XPathNodeType.SignificantWhitespace:
                        break;

                    default:
                        throw XsltException.Create(Res.Xslt_InvalidContents, "apply-templates");
                    }
                }while (compiler.Advance());

                compiler.ToParent();
            }
        }
예제 #3
0
 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 XsltException.Create(SR.Xslt_DuplicateWithParam, name.ToString());
             }
         }
     }
 }
예제 #4
0
 public virtual WithParamAction CreateWithParamAction()
 {
     WithParamAction action = new WithParamAction();
     action.Compile(this);
     return action;
 }