Move the @StreamResultWriter
annotation from the class and onto the SAXToXMLWriter
instance declaration. This results in Smooks creating the SAXToXMLWriter
instance which is then initialized with the rewriteEntities
filter setting for the associated Smooks instance:
@TextConsumer
public class MyVisitor implements SAXVisitAfter
{
@StreamResultWriter
private SAXToXMLWriter xmlWriter;
public void visitAfter(SAXElement element, ExecutionContext executionContext)
throws SmooksException, IOException
{
xmlWriter.writeStartElement(element);
xmlWriter.writeText(element);
xmlWriter.writeEndElement(element);
}
}