1 16 19 package org.apache.xalan.templates; 20 21 import javax.xml.transform.TransformerException ; 22 import org.apache.xalan.res.XSLMessages; 23 import org.apache.xalan.res.XSLTErrorResources; 24 import org.apache.xalan.transformer.TransformerImpl; 25 import org.apache.xpath.XPathContext; 26 27 28 32 public class ElemUnknown extends ElemLiteralResult 33 { 34 35 41 public int getXSLToken() 42 { 43 return Constants.ELEMNAME_UNDEFINED; 44 } 45 46 55 private void executeFallbacks( 56 TransformerImpl transformer) 57 throws TransformerException 58 { 59 for (ElemTemplateElement child = m_firstChild; child != null; 60 child = child.m_nextSibling) 61 { 62 if (child.getXSLToken() == Constants.ELEMNAME_FALLBACK) 63 { 64 try 65 { 66 transformer.pushElemTemplateElement(child); 67 ((ElemFallback) child).executeFallback(transformer); 68 } 69 finally 70 { 71 transformer.popElemTemplateElement(); 72 } 73 } 74 } 75 76 } 77 78 83 private boolean hasFallbackChildren() 84 { 85 for (ElemTemplateElement child = m_firstChild; child != null; 86 child = child.m_nextSibling) 87 { 88 if (child.getXSLToken() == Constants.ELEMNAME_FALLBACK) 89 return true; 90 } 91 92 return false; 93 } 94 95 96 106 public void execute(TransformerImpl transformer) 107 throws TransformerException 108 { 109 110 111 if (TransformerImpl.S_DEBUG) 112 transformer.getTraceManager().fireTraceEvent(this); 113 114 try { 115 116 if (hasFallbackChildren()) { 117 executeFallbacks(transformer); 118 } else { 119 } 121 122 } catch (TransformerException e) { 123 transformer.getErrorListener().fatalError(e); 124 } 125 if (TransformerImpl.S_DEBUG) 126 transformer.getTraceManager().fireTraceEndEvent(this); 127 } 128 129 } 130 | Popular Tags |