1 package org.ejen; 22 23 import org.apache.xalan.transformer.TransformerImpl; 24 import org.apache.xalan.templates.StylesheetRoot; 25 26 72 public class EjenIncludeNode extends EjenStylesheetNode { 73 74 78 public String nodeName() { 79 return "include"; 80 } 81 82 86 public void process() { 87 super.process(); 88 try { 89 TransformerImpl ti = (TransformerImpl) (getFromContext(CTX_TRANSFORMER_IMPL)); 90 91 if (ti == null) { 92 throw new EjenException(this, 93 "no '" + CTX_TRANSFORMER_IMPL + "' in context"); 94 } 95 StylesheetRoot sr = (StylesheetRoot) (getFromContext(CTX_STYLESHEET_ROOT, 96 -1)); 97 98 if (sr == null) { 99 throw new EjenException(this, 100 "no '" + CTX_STYLESHEET_ROOT + "' in context"); 101 } 102 sr.setInclude(ti.getStylesheet()); 103 } catch (EjenException e) { 104 throw e; 105 } catch (Exception e) { 106 throw new EjenException(this, "bad include", e); 107 } 108 } 109 } 110 | Popular Tags |