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