Code example for ContentHandler

Methods: startDocument, startElement

0
		} 
 
		public void startDocument() throws SAXException 
		{ 
			emitLast(); 
			next.startDocument();
		} 
 
		public void endDocument() throws SAXException 
		{ 
			emitLast(); 
			next.endDocument();
		} 
 
		public void startPrefixMapping(String arg0, String arg1)
				throws SAXException 
		{ 
			emitLast(); 
			next.startPrefixMapping(arg0, arg1);
		} 
 
		public void endPrefixMapping(String arg0) throws SAXException
		{ 
			emitLast(); 
			next.endPrefixMapping(arg0);
		} 
 
		public void emitLast() throws SAXException 
		{ 
			if (lastElement != null)
			{ 
				// this means that there was a startElement, startElement, 
				// so the lastElement MUST be emited 
				next.startElement(lastElement.ns, lastElement.qname,
						lastElement.lname, lastElement.atts);
				lastElement = null;
			} 
		}