java.io.IOException,
org.xml.sax.SAXException
{
String fileName = getFilename(context, elem);
Object flObject = m_formatterListeners.get(fileName);
DocumentHandler formatter;
boolean inTable = false;
if(null == flObject)
{
String mkdirsExpr = ((ElemExtensionCall)elem).getAttribute ("mkdirs", context.sourceNode, context.processor);
boolean mkdirs = (mkdirsExpr != null)
? (mkdirsExpr.equals("true") || mkdirsExpr.equals("yes")) : true;
formatter = makeFormatterListener(context, fileName, true, mkdirs);
}
else
{
inTable = true;
formatter = (DocumentHandler)flObject;
}
context.processor.writeChildren( formatter, context.stylesheetTree,
(ElemTemplateElement)elem,
context.sourceTree, context.sourceNode, context.mode);
if(!inTable)
{
OutputStream ostream = (OutputStream)m_outputStreams.get(fileName);
if(null != ostream)
{
formatter.endDocument();
ostream.close();
m_outputStreams.remove(fileName);
m_formatterListeners.remove(fileName);
}
}