private Tokenizer newTokenizer(TokenHandler handler, boolean newAttributesEachTime) {
if (errorHandler == null && transitionHandler == null &&
contentNonXmlCharPolicy == XmlViolationPolicy.ALLOW) {
return new Tokenizer(handler, newAttributesEachTime);
}
ErrorReportingTokenizer tokenizer =
new ErrorReportingTokenizer(handler, newAttributesEachTime);
tokenizer.setErrorProfile(errorProfileMap);
return tokenizer;
}