CreateSortAction() public method

public CreateSortAction ( ) : SortAction
return SortAction
Ejemplo n.º 1
0
        protected void CompileSortElements(Compiler compiler)
        {
            NavigatorInput input = compiler.Input;

            do
            {
                switch (input.NodeType)
                {
                case XPathNodeType.Element:
                    if (Ref.Equal(input.NamespaceURI, input.Atoms.UriXsl) &&
                        Ref.Equal(input.LocalName, input.Atoms.Sort))
                    {
                        if (sortContainer == null)
                        {
                            sortContainer = new ContainerAction();
                        }
                        sortContainer.AddAction(compiler.CreateSortAction());
                        continue;
                    }
                    return;

                case XPathNodeType.Text:
                    return;

                case XPathNodeType.SignificantWhitespace:
                    this.AddEvent(compiler.CreateTextEvent());
                    continue;

                default:
                    continue;
                }
            }while (input.Advance());
        }
Ejemplo n.º 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();
            }
        }
 protected void CompileSortElements(Compiler compiler) {
     NavigatorInput input = compiler.Input;            
     do {
         switch(input.NodeType) {
         case XPathNodeType.Element:
             if (Keywords.Equals(input.NamespaceURI, input.Atoms.XsltNamespace) &&
                 Keywords.Equals(input.LocalName, input.Atoms.Sort)) {
                 if (sortContainer == null) {
                     sortContainer = new ContainerAction();
                 }
                 sortContainer.AddAction(compiler.CreateSortAction());
                 continue;
             }
             return;
         case XPathNodeType.Text:
             return;
         case XPathNodeType.SignificantWhitespace:
             this.AddEvent(compiler.CreateTextEvent());
             continue;
         default :
             continue;
         }
     }
     while (input.Advance());
 }
Ejemplo n.º 4
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(SR.Xslt_InvalidContents, "apply-templates");
                    }
                }
                while (compiler.Advance());

                compiler.ToParent();
            }
        }