1 16 19 package org.apache.xalan.templates; 20 21 import javax.xml.transform.SourceLocator ; 22 import javax.xml.transform.TransformerException ; 23 24 import org.apache.xalan.transformer.TransformerImpl; 25 import org.apache.xml.utils.QName; 26 import org.apache.xpath.XPath; 27 import org.apache.xpath.XPathContext; 28 29 50 public class ElemTemplate extends ElemTemplateElement 51 { 52 54 private String m_publicId; 55 56 58 private String m_systemId; 59 60 67 public String getPublicId() 68 { 69 return m_publicId; 70 } 71 72 82 public String getSystemId() 83 { 84 return m_systemId; 85 } 86 87 92 public void setLocaterInfo(SourceLocator locator) 93 { 94 95 m_publicId = locator.getPublicId(); 96 m_systemId = locator.getSystemId(); 97 98 super.setLocaterInfo(locator); 99 } 100 101 107 private Stylesheet m_stylesheet; 108 109 115 public StylesheetComposed getStylesheetComposed() 116 { 117 return m_stylesheet.getStylesheetComposed(); 118 } 119 120 125 public Stylesheet getStylesheet() 126 { 127 return m_stylesheet; 128 } 129 130 135 public void setStylesheet(Stylesheet sheet) 136 { 137 m_stylesheet = sheet; 138 } 139 140 145 public StylesheetRoot getStylesheetRoot() 146 { 147 return m_stylesheet.getStylesheetRoot(); 148 } 149 150 155 private XPath m_matchPattern = null; 156 157 168 public void setMatch(XPath v) 169 { 170 m_matchPattern = v; 171 } 172 173 184 public XPath getMatch() 185 { 186 return m_matchPattern; 187 } 188 189 193 private QName m_name = null; 194 195 204 public void setName(QName v) 205 { 206 m_name = v; 207 } 208 209 218 public QName getName() 219 { 220 return m_name; 221 } 222 223 228 private QName m_mode; 229 230 239 public void setMode(QName v) 240 { 241 m_mode = v; 242 } 243 244 253 public QName getMode() 254 { 255 return m_mode; 256 } 257 258 263 private double m_priority = XPath.MATCH_SCORE_NONE; 264 265 275 public void setPriority(double v) 276 { 277 m_priority = v; 278 } 279 280 290 public double getPriority() 291 { 292 return m_priority; 293 } 294 295 301 public int getXSLToken() 302 { 303 return Constants.ELEMNAME_TEMPLATE; 304 } 305 306 311 public String getNodeName() 312 { 313 return Constants.ELEMNAME_TEMPLATE_STRING; 314 } 315 316 320 public int m_frameSize; 321 322 326 int m_inArgsSize; 327 328 334 private int[] m_argsQNameIDs; 335 336 342 public void compose(StylesheetRoot sroot) throws TransformerException 343 { 344 super.compose(sroot); 345 StylesheetRoot.ComposeState cstate = sroot.getComposeState(); 346 java.util.Vector vnames = cstate.getVariableNames(); 347 if(null != m_matchPattern) 348 m_matchPattern.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize()); 349 350 cstate.resetStackFrameSize(); 351 m_inArgsSize = 0; 352 } 353 354 357 public void endCompose(StylesheetRoot sroot) throws TransformerException 358 { 359 StylesheetRoot.ComposeState cstate = sroot.getComposeState(); 360 super.endCompose(sroot); 361 m_frameSize = cstate.getFrameSize(); 362 363 cstate.resetStackFrameSize(); 364 } 365 366 377 public void execute( 378 TransformerImpl transformer) 379 throws TransformerException 380 { 381 XPathContext xctxt = transformer.getXPathContext(); 382 383 transformer.getStackGuard().checkForInfinateLoop(); 384 385 xctxt.pushRTFContext(); 386 387 if (TransformerImpl.S_DEBUG) 388 transformer.getTraceManager().fireTraceEvent(this); 389 390 transformer.executeChildTemplates(this, true); 394 404 if (TransformerImpl.S_DEBUG) 405 transformer.getTraceManager().fireTraceEndEvent(this); 406 407 xctxt.popRTFContext(); 408 } 409 410 415 public void recompose(StylesheetRoot root) 416 { 417 root.recomposeTemplates(this); 418 } 419 420 } 421 | Popular Tags |