Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CallTemplateAction.cs
Go to the documentation of this file.
2
4
6{
8
15
16 internal override bool CompileAttribute(Compiler compiler)
17 {
18 string localName = compiler.Input.LocalName;
19 string value = compiler.Input.Value;
20 if (Ref.Equal(localName, compiler.Atoms.Name))
21 {
22 _name = compiler.CreateXPathQName(value);
23 return true;
24 }
25 return false;
26 }
27
29 {
31 if (!compiler.Recurse())
32 {
33 return;
34 }
35 do
36 {
37 switch (input.NodeType)
38 {
39 case XPathNodeType.Element:
40 {
41 compiler.PushNamespaceScope();
43 string localName = input.LocalName;
44 if (Ref.Equal(namespaceURI, input.Atoms.UriXsl) && Ref.Equal(localName, input.Atoms.WithParam))
45 {
46 WithParamAction withParamAction = compiler.CreateWithParamAction();
49 compiler.PopScope();
50 break;
51 }
52 throw compiler.UnexpectedKeyword();
53 }
54 default:
55 throw XsltException.Create(System.SR.Xslt_InvalidContents, "call-template");
56 case XPathNodeType.SignificantWhitespace:
57 case XPathNodeType.Whitespace:
58 case XPathNodeType.ProcessingInstruction:
59 case XPathNodeType.Comment:
60 break;
61 }
62 }
63 while (compiler.Advance());
64 compiler.ToParent();
65 }
66
67 internal override void Execute(Processor processor, ActionFrame frame)
68 {
69 switch (frame.State)
70 {
71 case 0:
72 processor.ResetParams();
73 if (containedActions != null && containedActions.Count > 0)
74 {
75 processor.PushActionFrame(frame);
76 frame.State = 2;
77 break;
78 }
79 goto case 2;
80 case 2:
81 {
82 TemplateAction templateAction = processor.Stylesheet.FindTemplate(_name);
83 if (templateAction != null)
84 {
85 frame.State = 3;
86 processor.PushActionFrame(templateAction, frame.NodeSet);
87 break;
88 }
90 }
91 case 3:
92 frame.Finished();
93 break;
94 case 1:
95 break;
96 }
97 }
98}
static string Xslt_InvalidContents
Definition SR.cs:2076
static string Xslt_InvalidCallTemplate
Definition SR.cs:1924
Definition SR.cs:7
static bool Equal(string strA, string strB)
Definition Ref.cs:5
static XsltException Create(string res, params string[] args)
override bool CompileAttribute(Compiler compiler)
override void Execute(Processor processor, ActionFrame frame)
override void Compile(Compiler compiler)
void CompileAttributes(Compiler compiler)
void CheckRequiredAttribute(Compiler compiler, object attrValue, string attrName)
void CheckDuplicateParams(XmlQualifiedName name)