return event;
}
private XMLEvent tryChunking(StartElement startElement) throws XMLStreamException {
QName elementName = startElement.getName();
CharacterEventSource characterEventSource = this.chunkingElements.get(elementName.getLocalPart());
while (characterEventSource != null) {
final XMLEvent previousEvent = this.getPreviousEvent();
if (previousEvent != null && previousEvent.isStartElement()) {
this.captureEvent = startElement;
//Write an empty Character event to force the serializer to finish writing the previous StartElement
//It is left open since ATTRIBUTE events can follow a START_ELEMENT event.
return EVENT_FACTORY.createCharacters("");
}
//Capture the characters written out to this point then clear the buffer
this.captureCharacterDataEvent();
//Get the generated events for the element
final XMLEventReader parent = this.getParent();
characterEventSource.generateCharacterEvents(this.request, parent, startElement, this.characterEvents);
//Read the next event off the reader
final XMLEvent nextEvent = parent.nextEvent();
if (nextEvent.isStartElement()) {
startElement = nextEvent.asStartElement();