Code example for SAXParseException

0
	{ 
		if(!gotFirstTag)
		{ 
			String expectedTag = currentLoader.getTag();
			if(!qName.equals(expectedTag))
				throw new SAXParseException("SimpleXmlParser expected root: " + expectedTag, null);
			gotFirstTag = true;
			currentLoader.startDocument(attributes);
			return; 
		} 
		SimpleXmlDefaultLoader newLoader = currentLoader.startElement(qName);
		insertNewCurrentLoader(newLoader);
		currentLoader.startDocument(attributes);
	} 
 
	public void characters(char[] ch, int start, int length)
		throws SAXException 
	{ 
		currentLoader.addText(ch, start, length);
	}