Hi,

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");

           xmlHandler.setResult(streamResult);
           xmlHandler.startDocument();

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

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

                     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() :(

Rajath



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:
Hi,

I tried even that


xmlHandler
.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
Saxonica
------------------------------------------------------------------------------
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.
http://p.sf.net/sfu/splunk-d2d-oct_______________________________________________
saxon-help mailing list archived at
http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help