1 16 19 package org.apache.xalan.templates; 20 21 import javax.xml.transform.TransformerException ; 22 23 import org.apache.xalan.res.XSLMessages; 24 import org.apache.xalan.res.XSLTErrorResources; 25 import org.apache.xalan.transformer.TransformerImpl; 26 27 39 public class ElemMessage extends ElemTemplateElement 40 { 41 42 48 private boolean m_terminate = Constants.ATTRVAL_NO; 50 58 public void setTerminate(boolean v) 59 { 60 m_terminate = v; 61 } 62 63 71 public boolean getTerminate() 72 { 73 return m_terminate; 74 } 75 76 82 public int getXSLToken() 83 { 84 return Constants.ELEMNAME_MESSAGE; 85 } 86 87 92 public String getNodeName() 93 { 94 return Constants.ELEMNAME_MESSAGE_STRING; 95 } 96 97 111 public void execute( 112 TransformerImpl transformer) 113 throws TransformerException 114 { 115 116 if (TransformerImpl.S_DEBUG) 117 transformer.getTraceManager().fireTraceEvent(this); 118 119 String data = transformer.transformToString(this); 120 121 transformer.getMsgMgr().message(this, data, m_terminate); 122 123 if(m_terminate) 124 transformer.getErrorListener().fatalError(new TransformerException (XSLMessages.createMessage(XSLTErrorResources.ER_STYLESHEET_DIRECTED_TERMINATION, null))); 126 if (TransformerImpl.S_DEBUG) 127 transformer.getTraceManager().fireTraceEndEvent(this); 128 } 129 } 130 | Popular Tags |