Jo Shields 3c1f479b9d Imported Upstream version 4.0.0~alpha1
Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
2015-04-07 09:35:12 +01:00

42 lines
1.6 KiB
C#

//------------------------------------------------------------------------------
// <copyright file="ApplyImportsAction.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">[....]</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;
}
}
}
}