Ovanes Markarian wrote:
David,

how big is the chance that FormatterToXML gets a new member variable:
XalanDOMChar   m_indentChar;

which is default initialized with XalanUnicode::charSpace and a public member 
function:

void setIndentChar(XalanDOMChar ch);

This way the printSpace member function would call accumContent(m_indentChar) 
instead of
accumContent(XalanUnicode::charSpace):

void
FormatterToXML::printSpace(int n)
{
    for (int i = 0;  i < n;  i ++)
    {
                accumContent(m_indentChar);
    }
}

I think this change is minimal to the lib, but can bring some performance and 
size benefits. I can
post later what was the size change

By "performance and size benefits," I'm going to assume you mean in your particular case. Your's is the first request that I can remember for writing tabs instead of space characters when doing "pretty-printing."

If you're really interested in improved performance and reduced size, I suggest you forgo pretty-printing altogether. If you do that, then you can get much better performance using the XalanXMLSerializerFactory factory to create your FormatterListener. You'll then get a compile-time optimized FormatterListener that has no overhead at all for pretty-printing.

Dave

Reply via email to