On 13/10/2011 04:40, Rajath.Sakkari@continental-corporation.com wrote:

Hi,

I have attached the complete code.  This code was part of my main application, i separated it for simplicity. Now there is one more issue.

--> If local name is empty as below

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

it throws

org.xml.sax.SAXException: Parser configuration problem: namespace reporting is not enabled

Yes. We've explained why this happens and I think you now know how to fix it.


--> if local name is something like "abcxyz"

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

it throws

org.xml.sax.SAXException: java.lang.IllegalArgumentException: URI scheme is not "file"
net.sf.saxon.trans.XPathException: java.lang.IllegalArgumentException: URI scheme is not "file"
This is happening because you called

new StreamResult(fileOUT);

where fileOUT holds a Windows filename when the API specification requires a URI. You can change it to a URI ("file:///d:/out.xml"), or you can supply a Java File object instead:

new StreamResult(new File(fileOUT));

Michael Kay
Saxonica