Code example for ContentHandler

Methods: characters, endElement, ignorableWhitespace, startElement

0
        if (atts == null) {
            atts = new AttributesImpl();
        } 
        // make sure that the value is never null 
        value = value == null ? "" : value;
        handler.ignorableWhitespace(indentArray, 0, indent);
        handler.startElement(nsu, elementName, elementName, atts);
        handler.characters(value.toCharArray(), 0, value.length());
        handler.endElement(nsu, elementName, elementName);
    } 
 
    /* (non-Javadoc) 
     * @see org.xml.sax.XMLReader#parse(java.lang.String) 
     */ 
    public void parse(String systemId) throws IOException, SAXException {
        // Do nothing. Just for conformance to the XMLReader API. 
    } 
 
    /* (non-Javadoc) 
     * @see javax.xml.transform.sax.SAXSource#getXMLReader() 
     */