If the element is not in a namespace, but has local name "LLL", then you should supply "" as the namespace URI and "LLL" as both the local name and QName.

I'm afraid I don't know without considerable research why there was a change here between 8.9 and 9.1. They are both rather old releases. I expect it was a bug fix, or it might have been a performance tweak. Failing to supply the local name is incorrect, the only change is that the later Saxon release detects the error and the earlier one does not.

The SAX interface is a very low-level interface and if you choose to use it, you have to get the details right. Because it is designed for high performance, Saxon (when acting as the event receiver) does only minimal validation of the data supplied by the caller (the event supplier - which is usually a production XML parser).

I notice that you've taken the conversation off-list. Please avoid doing that - if people find a question in the archives of the list, they want to find the rest of the thread too.

Michael Kay
Saxonica

On 28/09/2011 06:50, Rajath.Sakkari@continental-corporation.com wrote:
Hi,

So you suggest me to give a implicit URI? Actually I do not have any namespace as such.
why is this problem in saxon-9.1.0.8.jar and why not in saxon-8.9.0.4.jar ?

Thanks and Regards,
S.K.Rajath
E-Mail:  rajath.sakkari@continental-corporation.com



From:        Michael Kay <mike@saxonica.com>
To:        Rajath.Sakkari@continental-corporation.com, Saxon Help List <saxon-help@lists.sourceforge.net>
Date:        09/24/2011 12:56 AM
Subject:        Re: [saxon] Saxon : XPathSelector




On 23/09/2011 05:17, Rajath.Sakkari@continental-corporation.com wrote:
Hi Michael,

The casting to XdmNode worked great. For this I am using saxon-9.1.0.8.jar.  But I am facing a conflict if I use this jar .


-
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:401)
       at net.sf.saxon.event.ReceivingContentHandler.startElement(
ReceivingContentHandler.java:278)

This conflict originates when i use
xmlHandler.startElement("","",qname,attributes).
You need to supply the URI and local name when calling startElement: that is, you need to make the same calls on the SAX ContentHandler that a namespace-aware XML parser would make.

But if i use saxon-8.9.0.4.jar no errors occur but cant cast XdmItem to XdmNode. I am not sure of the problem.


XdmItem and XdmNode are part of the s9api interface, which was not introduced until Saxon 9.0 (IIRC). The current release is Saxon 9.3, and I would suggest moving forward.

Michael Kay
Saxonica