1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
package com.jclark.xsl.tr;
import com.jclark.xsl.om.*;
class StringResult implements Result {
private Result result;
private StringBuffer buf = new StringBuffer();
StringResult() {
this.result = null;
}
StringResult(Result result) {
this.result = result;
}
void clear() {
buf.setLength(0);
}
public String toString() {
return buf.toString();
}
public void characters(String str) throws XSLException {
buf.append(str);
}
public void rawCharacters(String str) throws XSLException {
throw new XSLException("illegal use of disable-output-escaping='yes'");
}
public void comment(String str) { }
public void processingInstruction(String target, String data) { }
public void attribute(Name name, String value) { }
public void startElement(Name elementType, NamespacePrefixMap nsMap) { }
public void endElement(Name elementType) { }
public void start(OutputMethod om) {
throw new Error("start on StringResult");
}
public void end() {
throw new Error("end on StringResult");
}
public Result createResult(String uri) {
return null;
}
public void message(Node node, String str) throws XSLException {
if (result != null)
result.message(node, str);
}
}
|