public void setFeature(String name,
boolean state) throws XMLStreamException
{
if(name == null) throw new IllegalArgumentException("feature name should not be nulll");
if(FEATURE_PROCESS_NAMESPACES.equals(name)) {
if(eventType != XMLStreamConstants.START_DOCUMENT) throw new XMLStreamException(
"namespace processing feature can only be changed before parsing",
getLocation());
processNamespaces = state;
// } else if(FEATURE_REPORT_NAMESPACE_ATTRIBUTES.equals(name)) {
// if(type != XMLStreamConstants.START_DOCUMENT) throw new XMLStreamException(
// "namespace reporting feature can only be changed before parsing",
// getLineNumber(), getColumnNumber(), getPositionDescription(), null);
// reportNsAttribs = state;
} else if(FEATURE_NAMES_INTERNED.equals(name)) {
if(state != false) {
throw new XMLStreamException(
"interning names in this implementation is not supported");
}
} else if(FEATURE_PROCESS_DOCDECL.equals(name)) {
if(state != false) {
throw new XMLStreamException(
"processing DOCDECL is not supported");
}
//} else if(REPORT_DOCDECL.equals(name)) {
// paramNotifyDoctype = state;
} else if(FEATURE_XML_ROUNDTRIP.equals(name)) {
if(state == false) {
throw new XMLStreamException(
"roundtrip feature can not be switched off");
}
} else {
throw new XMLStreamException("unknown feature "+name);
}
}