*/
public void execute(TransformerImpl transformer) throws TransformerException
{
XPathContext xctxt = transformer.getXPathContext();
ResultTreeHandler rth = transformer.getResultTreeHandler();
if (TransformerImpl.S_DEBUG)
transformer.getTraceManager().fireTraceEvent(this);
try
{
// Optimize for "."
if (false && m_isDot && !TransformerImpl.S_DEBUG)
{
int child = xctxt.getCurrentNode();
DTM dtm = xctxt.getDTM(child);
xctxt.pushCurrentNode(child);
if (m_disableOutputEscaping)
rth.processingInstruction(
javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, "");
try
{
dtm.dispatchCharactersEvents(child, rth, false);
}
finally
{
if (m_disableOutputEscaping)
rth.processingInstruction(
javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, "");
xctxt.popCurrentNode();
}
}
else
{
xctxt.pushNamespaceContext(this);
int current = xctxt.getCurrentNode();
xctxt.pushCurrentNodeAndExpression(current, current);
if (m_disableOutputEscaping)
rth.processingInstruction(
javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, "");
try
{
Expression expr = m_selectExpression.getExpression();
if (TransformerImpl.S_DEBUG)
{
XObject obj = expr.execute(xctxt);
transformer.getTraceManager().fireSelectedEvent(current, this,
"select", m_selectExpression, obj);
obj.dispatchCharactersEvents(rth);
}
else
{
expr.executeCharsToContentHandler(xctxt, rth);
}
}
finally
{
if (m_disableOutputEscaping)
rth.processingInstruction(
javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, "");
xctxt.popNamespaceContext();
xctxt.popCurrentNodeAndExpression();
}