void (final Trim trim, final String text) { // this resets the mtbuffer too. closeText(); String toadd = null; switch (trim) { case NONE: toadd = text; break; case BOTH: toadd = Format.trimBoth(text); break; case LEFT: toadd = Format.trimLeft(text); break; case RIGHT: toadd = Format.trimRight(text); break; case COMPACT: toadd = Format.compact(text); break; } toadd = escapeCDATA(toadd); ensurespace(); // mark this as being CDATA text mtdata[mtsize] = CDATATOKEN; mttext[mtsize++] = toadd; mtgottext = true; }