Basic functionality that i am trying to do is to create an xml file and write into it. Here is sample code.

 StreamResult streamResult = new StreamResult(fileOUT);
 SAXTransformerFactory tf = (SAXTransformerFactory) SAXTransformerFactory.newInstance();

           TransformerHandler xmlHandler = tf.newTransformerHandler();
           Transformer serializer = xmlHandler.getTransformer();

           serializer.setOutputProperty(OutputKeys.ENCODING, docEncoding);        
           serializer.setOutputProperty(OutputKeys.INDENT, "yes");


           DateFormat dateFormat = new SimpleDateFormat(timeSettings);
           Date date = new Date();
           AttributesImpl atts = new AttributesImpl();
           putAtt(atts, "time", dateFormat.format(date));
                String nodeName = "abcxyz";
                      xmlHandler.startElement(XMLConstants.NULL_NS_URI, nodeName, nodeName, atts);

                     xmlHandler.startElement(XMLConstants.NULL_NS_URI, "",nodeName, atts);

                     xmlHandler.startElement("", "","", atts);

For all these trials i got the same error as below.

org.xml.sax.SAXException: Parser configuration problem: namespace reporting is not enabled
org.xml.sax.SAXException: Parser configuration problem: namespace reporting is not enabled
at net.sf.saxon.event.ReceivingContentHandler.getNameCode(ReceivingContentHandler.java:383)
at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:314)

Also here I am using SAXTransformerFactory and its TransformHandler. So dose this act differently than normal ContentHandler ?

I am allover startElement() :(


From:        Michael Kay <mike@saxonica.com>
To:        saxon-help@lists.sourceforge.net
Date:        10/12/2011 03:13 PM
Subject:        Re: [saxon] Parser configuration problem: namespace reporting is not        enabled

On 12/10/2011 10:25, Rajath.Sakkari@continental-corporation.com wrote:

I tried even that

.startElement(XMLConstants.NULL_NS_URI, nodeName,nodeName, atts);

but no success. I tried with all local node names i have. I am missing something here do not know what :(

The error message you reported happens only if the second argument (the local name) is an empty string. If you're passing something other than an empty string, then please let us know more precisely what you did and what the effect was.

Michael Kay
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
saxon-help mailing list archived at