1 16 19 package org.apache.xalan.templates; 20 21 import javax.xml.transform.TransformerException ; 22 23 import org.apache.xalan.transformer.TransformerImpl; 24 import org.apache.xpath.XPathContext; 25 import org.apache.xpath.objects.XObject; 26 27 30 public class ElemExsltFuncResult extends ElemVariable 31 { 32 33 38 public void execute(TransformerImpl transformer) throws TransformerException 39 { 40 XPathContext context = transformer.getXPathContext(); 41 42 if (TransformerImpl.S_DEBUG) 43 transformer.getTraceManager().fireTraceEvent(this); 44 45 if (transformer.currentFuncResultSeen()) { 49 throw new TransformerException ("An EXSLT function cannot set more than one result!"); 50 } 51 52 int sourceNode = context.getCurrentNode(); 53 54 XObject var = getValue(transformer, sourceNode); 56 transformer.popCurrentFuncResult(); 57 transformer.pushCurrentFuncResult(var); 58 59 if (TransformerImpl.S_DEBUG) 60 transformer.getTraceManager().fireTraceEndEvent(this); 61 } 62 63 70 public int getXSLToken() 71 { 72 return Constants.EXSLT_ELEMNAME_FUNCRESULT; 73 } 74 75 82 public String getNodeName() 83 { 84 return Constants.EXSLT_ELEMNAME_FUNCRESULT_STRING; 85 } 86 } 87 | Popular Tags |