/** * Switches to the "marshal child texts/elements" mode. * This method has to be called after the 1st pass is completed. */ public void endAttributes() throws SAXException { // calculate QName of the element String uri = getCurrentElementUri(); String local = getCurrentElementLocal(); String prefix = nsContext.declareNamespace(uri,false); String qname = local; if(prefix!=null) qname = prefix+':'+qname; // fire startPrefixMapping events nsContext.iterateDeclaredPrefixes(startPrefixCallback); // fire the startElement event writer.startElement( uri, local, qname, attributes ); // reset attributes attributes.clear(); // prepare to collect texts _assert(textBuf==null); textBuf = new StringBuffer(); }
/** * Ends marshalling of an element. * Pops the internal stack. */ public void endElement() throws SAXException { writePendingText(); String uri = getCurrentElementUri(); String local = getCurrentElementLocal(); String prefix = nsContext.getPrefix(uri); String qname = local; if(prefix!=null) qname = prefix+':'+qname; writer.endElement( uri, local, qname ); // pop namespace bindings and // fire endPrefixMapping events nsContext.iterateDeclaredPrefixes(endPrefixCallback); popElement(); // prepare to collect texts _assert(textBuf==null); textBuf = new StringBuffer(); nsContext.endElement(); }