2

I am stuck with this error

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

while running the following code

xmlHandler.startElement("D:\XmlFiles\XmlFromRhapsody.xml", "", qName, atts);

xmlHandler is --> TransformerHandler xmlHandler;

I am not sure of enabling namespace.

Dimitre Novatchev
  • 240,661
  • 26
  • 293
  • 431
naamadheya
  • 1,902
  • 5
  • 21
  • 28

1 Answers1

1

You can fix this by supplying the localname when calling the startElement method. This means that you to make the same calls to the ContentHandler that a namespace-aware XML parser would make.

So, you have ..

xmlHandler.startElement("D:\XmlFiles\XmlFromRhapsody.xml", "", qName, atts);

You need to add the local name as the 2nd parameter instead of leaving it blank.

Also, If you don't want to make these changes you can use saxon-8.9.0.4.jar which should work without any errors.

j0k
  • 22,600
  • 28
  • 79
  • 90