Code example for ContentHandler

Methods: processingInstruction, startElement

0
		{ 
			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;
			} 
		} 
 
		public void startElement(String ns, String qname, String lname,
				Attributes atts) throws SAXException
		{ 
			emitLast(); 
			if (ignoreEmpty.get(lname.toLowerCase()) != null)
			{ 
				lastElement = new EStack(ns, qname, lname, atts, null);
			} 
			else 
			{ 
				next.startElement(ns, qname, lname, atts);
			} 
		} 
 
		public void endElement(String arg0, String arg1, String arg2)
				throws SAXException 
		{ 
			if (lastElement != null)
			{ 
				// there was a start, then an end with nothing in between 
				// so ignore alltogether 
				lastElement = null;
			} 
			else 
			{ 
				next.endElement(arg0, arg1, arg2);
			} 
		} 
 
		public void characters(char[] arg0, int arg1, int arg2)
				throws SAXException 
		{ 
			emitLast(); 
			next.characters(arg0, arg1, arg2);
		} 
 
		public void ignorableWhitespace(char[] arg0, int arg1, int arg2)
				throws SAXException 
		{ 
			emitLast(); 
			next.ignorableWhitespace(arg0, arg1, arg2);
		} 
 
		public void processingInstruction(String arg0, String arg1)
				throws SAXException 
		{ 
			emitLast(); 
			next.processingInstruction(arg0, arg1);
		} 
 
		public void skippedEntity(String arg0) throws SAXException
		{ 
			emitLast();