1 //------------------------------------------------------------------------------
2 // <copyright file="ApplyImportsAction.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 // <owner current="true" primary="true">Microsoft</owner>
6 //------------------------------------------------------------------------------
8 namespace System
.Xml
.Xsl
.XsltOld
{
9 using Res
= System
.Xml
.Utils
.Res
;
11 using System
.Diagnostics
;
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
) {
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
) {
32 processor
.PushTemplateLookup(frame
.NodeSet
, this.mode
, /*importsOf:*/this.stylesheet
);
33 frame
.State
= TemplateProcessed
;
35 case TemplateProcessed
: