1 16 19 package org.apache.xalan.templates; 20 21 import javax.xml.transform.TransformerException ; 22 23 import org.apache.xalan.res.XSLTErrorResources; 24 import org.apache.xalan.transformer.TransformerImpl; 25 import org.apache.xml.dtm.DTM; 26 27 35 public class ElemApplyImport extends ElemTemplateElement 36 { 37 38 44 public int getXSLToken() 45 { 46 return Constants.ELEMNAME_APPLY_IMPORTS; 47 } 48 49 54 public String getNodeName() 55 { 56 return Constants.ELEMNAME_APPLY_IMPORTS_STRING; 57 } 58 59 68 public void execute( 69 TransformerImpl transformer) 70 throws TransformerException 71 { 72 73 if (transformer.currentTemplateRuleIsNull()) 74 { 75 transformer.getMsgMgr().error(this, 76 XSLTErrorResources.ER_NO_APPLY_IMPORT_IN_FOR_EACH); } 78 79 if (TransformerImpl.S_DEBUG) 80 transformer.getTraceManager().fireTraceEvent(this); 81 82 int sourceNode = transformer.getXPathContext().getCurrentNode(); 83 if (DTM.NULL != sourceNode) 84 { 85 86 transformer.applyTemplateToNode(this, null, sourceNode); 89 } 90 else { 92 transformer.getMsgMgr().error(this, 93 XSLTErrorResources.ER_NULL_SOURCENODE_APPLYIMPORTS); } 95 if (TransformerImpl.S_DEBUG) 96 transformer.getTraceManager().fireTraceEndEvent(this); 97 } 98 99 107 public ElemTemplateElement appendChild(ElemTemplateElement newChild) 108 { 109 110 error(XSLTErrorResources.ER_CANNOT_ADD, 111 new Object []{ newChild.getNodeName(), 112 this.getNodeName() }); 114 return null; 116 } 117 } 118 | Popular Tags |