开发者

org.xml.sax.SAXException: Parser configuration problem:

开发者 https://www.devze.com 2023-04-09 02:31 出处:网络
I am stuck with this error org.xml.sax.SAXException: Parser confi开发者_StackOverflow社区guration problem: namespace reporting is not enabled

I am stuck with this error

org.xml.sax.SAXException: Parser confi开发者_StackOverflow社区guration 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号