Updates referencesource to .NET 4.7
[mono-project.git] / mcs / class / referencesource / System.Data.SqlXml / System / Xml / Xsl / XsltOld / ApplyImportsAction.cs
blobdb9430ed1a0646bd3085ba964bb05c123daf5bdd
1 //------------------------------------------------------------------------------
2 // <copyright file="ApplyImportsAction.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
4 // </copyright>
5 // <owner current="true" primary="true">Microsoft</owner>
6 //------------------------------------------------------------------------------
8 namespace System.Xml.Xsl.XsltOld {
9 using Res = System.Xml.Utils.Res;
10 using System;
11 using System.Diagnostics;
12 using System.Xml;
13 using System.Xml.XPath;
15 internal class ApplyImportsAction : CompiledAction {
16 private XmlQualifiedName mode;
17 private Stylesheet stylesheet;
18 private const int TemplateProcessed = 2;
19 internal override void Compile(Compiler compiler) {
20 CheckEmpty(compiler);
21 if (! compiler.CanHaveApplyImports) {
22 throw XsltException.Create(Res.Xslt_ApplyImports);
24 this.mode = compiler.CurrentMode;
25 this.stylesheet = compiler.CompiledStylesheet;
28 internal override void Execute(Processor processor, ActionFrame frame) {
29 Debug.Assert(processor != null && frame != null);
30 switch (frame.State) {
31 case Initialized:
32 processor.PushTemplateLookup(frame.NodeSet, this.mode, /*importsOf:*/this.stylesheet);
33 frame.State = TemplateProcessed;
34 break;
35 case TemplateProcessed:
36 frame.Finished();
37 break;