if (ap instanceof Writer) {
fs = new WriterOutputSource((Writer)ap);
} else if (ap instanceof StringBuilder) {
fs = new StringBuilderOutputSource((StringBuilder)ap);
} else {
fs = new AppendableOutputSource(ap);
}
context.enter('$');
source = preformatInternal(context, source);
formatInternal(context, source, fs);