System.Xml.Xsl.XsltOld.Compiler.AddTemplate C# (CSharp) Method

AddTemplate() private method

private AddTemplate ( TemplateAction template ) : void
template TemplateAction
return void
        internal void AddTemplate(TemplateAction template)
        {
            Debug.Assert(this.stylesheet == _stylesheets.Peek());
            this.stylesheet.AddTemplate(template);
        }

Usage Example

Ejemplo n.º 1
0
        internal void CompileSingleTemplate(Compiler compiler)
        {
            NavigatorInput input = compiler.Input;

            //
            // find mandatory version attribute and launch compilation of single template
            //

            string?version = null;

            if (input.MoveToFirstAttribute())
            {
                do
                {
                    string nspace = input.NamespaceURI;
                    string name   = input.LocalName;

                    if (Ref.Equal(nspace, input.Atoms.UriXsl) &&
                        Ref.Equal(name, input.Atoms.Version))
                    {
                        version = input.Value;
                    }
                }while (input.MoveToNextAttribute());
                input.ToParent();
            }

            if (version == null)
            {
                if (Ref.Equal(input.LocalName, input.Atoms.Stylesheet) &&
                    input.NamespaceURI == XmlReservedNs.NsWdXsl)
                {
                    throw XsltException.Create(SR.Xslt_WdXslNamespace);
                }
                throw XsltException.Create(SR.Xslt_WrongStylesheetElement);
            }

            compiler.AddTemplate(compiler.CreateSingleTemplateAction());
        }
All Usage Examples Of System.Xml.Xsl.XsltOld.Compiler::AddTemplate