throws TransformerException
{
try
{
ResultTreeHandler rhandler = transformer.getResultTreeHandler();
// Add namespace declarations.
executeNSDecls(transformer);
rhandler.startElement(getNamespace(), getLocalName(), getRawName(), null);
try
{
// Process any possible attributes from xsl:use-attribute-sets first
super.execute(transformer, sourceNode, mode);
//xsl:version, excludeResultPrefixes???
// Process the list of avts next
if (null != m_avts)
{
int nAttrs = m_avts.size();
for (int i = (nAttrs - 1); i >= 0; i--)
{
AVT avt = (AVT) m_avts.elementAt(i);
XPathContext xctxt = transformer.getXPathContext();
String stringedValue = avt.evaluate(xctxt, sourceNode, this);
if (null != stringedValue)
{
// Important Note: I'm not going to check for excluded namespace
// prefixes here. It seems like it's to expensive, and I'm not
// even sure this is right. But I could be wrong, so this needs
// to be tested against other implementations.
rhandler.addAttribute(avt.getURI(), avt.getName(),
avt.getRawName(), "CDATA", stringedValue);
}
} // end for
}
// Now process all the elements in this subtree
// TODO: Process m_extensionElementPrefixes && m_attributeSetsNames
transformer.executeChildTemplates(this, sourceNode, mode, true);
}
catch(TransformerException te)
{
throw te;
}
finally
{
// If you don't do this in a finally statement, an exception could
// cause a system hang.
rhandler.endElement(getNamespace(), getLocalName(), getRawName());
unexecuteNSDecls(transformer);
}
}
catch (org.xml.sax.SAXException se)
{