File: InvokeAction.java

package info (click to toggle)
libxt-java 0.19991105-5
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,908 kB
  • ctags: 2,762
  • sloc: java: 12,823; makefile: 52; xml: 46
file content (28 lines) | stat: -rw-r--r-- 858 bytes parent folder | download | duplicates (2)
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
package com.jclark.xsl.tr;

import com.jclark.xsl.om.*;
import com.jclark.xsl.expr.VariantExpr;
import com.jclark.xsl.expr.Variant;
import java.util.Hashtable;

class InvokeAction extends ParamAction {
  private Name name;
  private Hashtable namedTemplateTable;

  InvokeAction(Name name, Hashtable namedTemplateTable) throws XSLException {
    this.name = name;
    this.namedTemplateTable = namedTemplateTable;
  }

  public void invoke(ProcessContext context, Node sourceNode, Result result)
    throws XSLException {
    Action action = (Action)namedTemplateTable.get(name);
    if (action == null)
      throw new XSLException(name.toString() + ": no such named template");
    context.invokeWithParams(action,
			     getParamNames(),
			     getParamValues(sourceNode, context),
			     sourceNode,
			     result);
  }
}