@Override public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException { UnmarshallingContext context = state.getContext(); if (state.getTarget() == null) state.setTarget(new State(context)); State s = (State) state.getTarget(); try { s.declarePrefixes(context, context.getNewlyDeclaredPrefixes()); s.handler.startElement(ea.uri, ea.local, ea.getQname(), ea.atts); } catch (SAXException e) { context.handleError(e); throw e; } }
@Override public void leaveElement(UnmarshallingContext.State state, TagName ea) throws SAXException { State s = (State) state.getTarget(); UnmarshallingContext context = state.getContext(); try { s.handler.endElement(ea.uri, ea.local, ea.getQname()); s.undeclarePrefixes(context.getNewlyDeclaredPrefixes()); } catch( SAXException e ) { context.handleError(e); throw e; } if((--s.depth)==0) { // emulate the end of the document try { s.undeclarePrefixes(context.getAllDeclaredPrefixes()); s.handler.endDocument(); } catch( SAXException e ) { context.handleError(e); throw e; } // we are done state.setTarget(s.getElement()); } }
@Override public void leaveElement(UnmarshallingContext.State state, TagName ea) throws SAXException { State s = (State) state.getTarget(); UnmarshallingContext context = state.getContext(); try { s.handler.endElement(ea.uri, ea.local, ea.getQname()); s.undeclarePrefixes(context.getNewlyDeclaredPrefixes()); } catch( SAXException e ) { context.handleError(e); throw e; } if((--s.depth)==0) { // emulate the end of the document try { s.undeclarePrefixes(context.getAllDeclaredPrefixes()); s.handler.endDocument(); } catch( SAXException e ) { context.handleError(e); throw e; } // we are done state.setTarget(s.getElement()); } }
@Override public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException { UnmarshallingContext context = state.getContext(); if (state.getTarget() == null) state.setTarget(new State(context)); State s = (State) state.getTarget(); try { s.declarePrefixes(context, context.getNewlyDeclaredPrefixes()); s.handler.startElement(ea.uri, ea.local, ea.getQname(), ea.atts); } catch (SAXException e) { context.handleError(e); throw e; } }
@Override public void leaveElement(UnmarshallingContext.State state, TagName ea) throws SAXException { State s = (State) state.getTarget(); UnmarshallingContext context = state.getContext(); try { s.handler.endElement(ea.uri, ea.local, ea.getQname()); s.undeclarePrefixes(context.getNewlyDeclaredPrefixes()); } catch( SAXException e ) { context.handleError(e); throw e; } if((--s.depth)==0) { // emulate the end of the document try { s.undeclarePrefixes(context.getAllDeclaredPrefixes()); s.handler.endDocument(); } catch( SAXException e ) { context.handleError(e); throw e; } // we are done state.setTarget(s.getElement()); } }
@Override public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException { UnmarshallingContext context = state.getContext(); if (state.getTarget() == null) state.setTarget(new State(context)); State s = (State) state.getTarget(); try { s.declarePrefixes(context, context.getNewlyDeclaredPrefixes()); s.handler.startElement(ea.uri, ea.local, ea.getQname(), ea.atts); } catch (SAXException e) { context.handleError(e); throw e; } }
@Override public void leaveElement(UnmarshallingContext.State state, TagName ea) throws SAXException { State s = (State) state.getTarget(); UnmarshallingContext context = state.getContext(); try { s.handler.endElement(ea.uri, ea.local, ea.getQname()); s.undeclarePrefixes(context.getNewlyDeclaredPrefixes()); } catch( SAXException e ) { context.handleError(e); throw e; } if((--s.depth)==0) { // emulate the end of the document try { s.undeclarePrefixes(context.getAllDeclaredPrefixes()); s.handler.endDocument(); } catch( SAXException e ) { context.handleError(e); throw e; } // we are done state.setTarget(s.getElement()); } }
@Override public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException { UnmarshallingContext context = state.getContext(); if (state.getTarget() == null) state.setTarget(new State(context)); State s = (State) state.getTarget(); try { s.declarePrefixes(context, context.getNewlyDeclaredPrefixes()); s.handler.startElement(ea.uri, ea.local, ea.getQname(), ea.atts); } catch (SAXException e) { context.handleError(e); throw e; } }