ElemTemplateElement elem, boolean shouldAddAttrs)
throws TransformerException
{
// Does this element have any children?
ElemTemplateElement t = elem.getFirstChildElem();
if (null == t)
return;
if(elem.hasTextLitOnly() && m_optimizer)
{
char[] chars = ((ElemTextLiteral)t).getChars();
try
{
// Have to push stuff on for tooling...
this.pushElemTemplateElement(t);
m_serializationHandler.characters(chars, 0, chars.length);
}
catch(SAXException se)
{
throw new TransformerException(se);
}
finally
{
this.popElemTemplateElement();
}
return;
}
// // Check for infinite loops if we have to.
// boolean check = (m_stackGuard.m_recursionLimit > -1);
//
// if (check)
// getStackGuard().push(elem, xctxt.getCurrentNode());
XPathContext xctxt = m_xcontext;
xctxt.pushSAXLocatorNull();
int currentTemplateElementsTop = m_currentTemplateElements.size();
m_currentTemplateElements.push(null);
try
{
// Loop through the children of the template, calling execute on
// each of them.
for (; t != null; t = t.getNextSiblingElem())
{
if (!shouldAddAttrs
&& t.getXSLToken() == Constants.ELEMNAME_ATTRIBUTE)
continue;
xctxt.setSAXLocator(t);
m_currentTemplateElements.setElementAt(t,currentTemplateElementsTop);
t.execute(this);
}
}
catch(RuntimeException re)
{
TransformerException te = new TransformerException(re);