You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Tim Wei <ti...@yahoo.com> on 2002/02/01 21:34:52 UTC

Why setIgnoringElementContentWhitespace method suddenly throw Throwable?

I have a method below. It was running fine before. Why suddenly
the following line of code throws me a Throwable with null
message?
dbf.setIgnoringElementContentWhitespace(true);

in the "catch (Throwable t)" block, it prints: Throwable caught
in toXML(): null

    public static Document toXML()
    {
        Document doc = null;
        try
        {
            DocumentBuilderFactory dbf =
DocumentBuilderFactory.newInstance();
            dbf.setIgnoringComments(true);
            dbf.setValidating(false);
            dbf.setIgnoringElementContentWhitespace(true);
            dbf.setCoalescing(true);
            dbf.setExpandEntityReferences(true);
            DocumentBuilder docBuilder = null;
            try
            {
                docBuilder = dbf.newDocumentBuilder();
            }
            catch (ParserConfigurationException pe)
            {
                System.out.println("ParserConfigurationException
caught in toXML(): " + pe.getMessage());
            }
            docBuilder.setErrorHandler(new DefaultHandler());
            doc = docBuilder.parse(new
File(EVENT_TEMPLATE_XML_FILE));
            // normalize text representation
            doc.getDocumentElement().normalize();
        } catch (SAXParseException err)
        {
            System.out.println("SAXParseException caught in
toXML(): " + err.getMessage());
        } catch (SAXException e)
        {
            System.out.println("SAXException caught in toXML():
" + e.getMessage());
        } catch (Exception ne)
        {
            System.out.println("Exception caught in toXML(): " +
ne.getMessage());
        } catch (Throwable t)
        {
            System.out.println("Throwable caught in toXML(): " +
t.getMessage());
        }
        return doc;
    }// end toXML()

=====
Tim's home page: 
http://www.geocities.com/timwei

__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com