// document.setProperty("ENCODING",
// ((StartDocument)event).getEncoding());
} else if (event instanceof javax.xml.stream.events.DTD) {
//List<?> list = (List<?>)reader.getProperty("javax.xml.stream.entities");
//System.out.println(list);
final DocType dtype = DTDParser.parse(((javax.xml.stream.events.DTD)event).getDocumentTypeDeclaration(), factory);
document.setDocType(dtype);
} else if (event.isStartElement()) {
final Element emt = processElement(factory, event.asStartElement());
if (current == null) {
document.setRootElement(emt);
final DocType dt = document.getDocType();
if (dt != null) {
dt.setElementName(emt.getName());
}
} else {
current.addContent(emt);
}
current = emt;