package de.gottox.saxmir.handlers;

import java.lang.reflect.Method;

import de.gottox.saxmir.Sx;
import de.gottox.saxmir.SxController;
import de.gottox.saxmir.css.CssNavigator;

public class ContentPlainHandler extends AbsHandler {
	final protected StringBuilder builder = new StringBuilder();
	protected CharSequence result;

	public ContentPlainHandler(SxController controller, Method m, Sx sx) {
		super(controller, m, sx);
		checkSignature(String.class, String.class);
	}

	@Override
	public void onCharacters(CssNavigator handler, CharSequence seq) {
		this.builder.append(seq);
	}

	@Override
	public void onEndMatching(CssNavigator handler, CharSequence tag) {
		try {
			method.invoke(controller, tag.toString(), this.builder.toString());
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}
@@ -61,16 +61,38 @@
 .Method;
+%0Aimport java.util.Map;
 %0A%0Aimport
@@ -253,14 +253,8 @@
  %7B%0A%09
-final 
 prot
@@ -594,24 +594,295 @@
 d(seq);%0A%09%7D%0A%0A
+%09@Override%0A%09public void onEndChild(CssNavigator handler, CharSequence tag) %7B%0A%09%09String tagStr = tag.toString().toLowerCase();%0A%09%09if(tagStr.equals(%22br%22) %7C%7C tagStr.equals(%22div%22))%0A%09%09%09this.builder.append('%5Cn');%0A%09%09else if(tagStr.equals(%22p%22))%0A%09%09%09this.builder.append(%22%5Cn%5Cn%22);%0A%09%7D%0A%0A
 %09@Override%0A%09
@@ -1028,16 +1028,55 @@
 ing());%0A
+%09%09%09this.builder = new StringBuilder();%0A
 %09%09%7D catc

Fix issue with doubled in multiple matches