I tried cutting this code down to eliminate all the dependencies, and I eventually got it to compile, and of course it ran with no problems.
 
Please try to create a test case that demonstrates the problem and that has no external dependencies on the rest of your environment.
 
Michael Kay
http://www.saxonica.com/


From: Rakesh guttal [mailto:rak_mail2001@rediffmail.com]
Sent: 10 December 2007 13:27
To: Michael Kay; saxon-help@lists.sourceforge.net
Subject: Re: RE: [saxon] Difference Between SAXON 8.8 and 9.0.0.1


Michael,

The catch(java.lang.Exeption e) block is not able to catch that exception.

Because, If i put a finally block, its getting executed.

1) Do I need to use any SAXON exception to catch such an exception?

2) There is one more evaluate method xpath.compile(query) before this evaluate method. It is executed properly. Only the evaluate method which i mentioned before is not executed properly.

Please find attached the complete file with this mail for your reference.

Thanks in advance,
Rakesh


On Mon, 10 Dec 2007 Michael Kay wrote :
>I don't see how execution can stop without an exception in the middle of the
>evaluate() method. If you can't make any further progress with the
>debugging, it looks as if you will have to package up the Java code in a
>form where I can execute it.
>
>Did you check that the factory is loading the Saxon implementation?
>
>Your XPath is not using regular expressions, so the change in regex
>behaviour is not relevant.
>
>Michael Kay
>http://www.saxonica.com/
>
>
>  _____
>
> From: saxon-help-bounces@lists.sourceforge.net
>[mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of Rakesh guttal
>Sent: 10 December 2007 12:45
>To: Michael Kay; saxon-help@lists.sourceforge.net
>Subject: Re: [saxon] Difference Between SAXON 8.8 and 9.0.0.1
>
>
>
>
>Michael,
>
>Unfortunately I am not getting any exeption when I execute the program.But i
>am sure the execution of program stops after executing evalute method.
>
>I think there is some problem in the XPATH expression that i am using.
>
>expression:
>("(. | *)[count(@*)=0 or count(@code)>0 or count(@size)>0 or
>count(@countryId)>0]")
>
>I got below comment from SAXON website from XPATH changes section:
>
>In regular expressions, a back-reference can no longer appear within a
>character class expression (thus "(abc|def)[\1]" is now illegal). This
>change has been agreed as an erratum by the W3C working groups, on the
>grounds that such an expression is meaningless.
>
>Please provide your inputs on this.
>
>Regards,
>Rakesh
>
>On Mon, 10 Dec 2007 Michael Kay wrote :
> >As a matter of principle, I would prefer it if you don't go off-list.
> >Although the conversation might not interest everyone on the list, it's
> >important that once the question is in the archives, the subsequent
> >correspondence and final conclusion should also be in the archives.
> >
> >If the System.out.println() line wasn't executed, then presumably an
> >exception was thrown by the evaluate() call. It would be nice to know what
> >that exception was. It should be easy for you to determine whether (a) the
> >exception occurred during the call on evaluate(), or (b) it occurred when
> >casting the result to a DOM NodeList.
> >
> >It would be useful to verify that the XPath implementation returned by the
> >factory is indeed the Saxon implementation. You can do this by printing the
> >class name of the returned instance.
> >
> >You should be able with Saxon 9.0 to rely on the fact that if node is an
> >instance of org.w3.dom.Node, then evaluate(node, XPathConstants.NODESET)
> >will return an instance of org.w3.dom.NodeList.
> >
> >Michael Kay
> >http://www.saxonica.com/
> >
> >
> >  _____
> >
> > From: Rakesh guttal [mailto:rak_mail2001@rediffmail.com]
> >Sent: 10 December 2007 11:28
> >To: Michael Kay
> >Subject: Re: RE: [saxon] Difference Between SAXON 8.8 and 9.0.0.1
> >
> >
> >
> >Hi Michael,
> >
> >Below is a part of code where i am facing some problems.
> >
> >    NodeList resultList      = null;
> >    XPathFactory factory      = null;
> >    XPath xpath                = null;
> >    XPathExpression members = null;
> >
> >    System.out.println("before setting system property");
> >
> >System.setProperty("javax.xml.xpath.XPathFactory:"+XPathConstants.DOM_OBJEC
>T
> >_MODEL,"net.sf.saxon.xpath.XPathFactoryImpl");
> >
> >System.setProperty("javax.xml.transform.TransformerFactory","net.sf.saxon.T
>r
> >ansformerFactoryImpl");
> >    String objectModel=XPathConstants.DOM_OBJECT_MODEL;
> >
> >
> >      try {
> >          factory      = XPathFactory.newInstance(objectModel);
> >      } catch (XPathFactoryConfigurationException e1) {
> >          System.out.println("exception thrown");
> >          e1.printStackTrace();
> >      }
> >      xpath          = factory.newXPath();
> >
> >
> >      members = xpath.compile("(. | *)[count(@*)=0 or count(@code)>0 or
> >count(@size)>0 or count(@countryId)>0]");
> >
> >      Node node=resultList.item(i);
> >
> >        System.out.println("before members.evaluate, node: "+node);
> >        // elements of bo tag
> >        NodeList children = (NodeList) members.evaluate(node,
> >XPathConstants.NODESET);
> >        System.out.println("after members.evaluate ");
> >
> >Note: node contains just one element.
> >
> >when using SAXON 8.8 (report is generated successfully), I get below output
> >
> >before members.evaluate, node: [option:null]
> >after members.evaluate
> >
> >when using SAXON 9.0. Jars used on classpath saxon9-dom.jar,saxon9sa.jar ,
> >saxon-xpath.jar & directory which contains license file. I get below output
> >
> >before members.evaluate, node: [option:null]
> >
> >It doesn't print the message "after members.evalute()" message.
> >
> >Does the newer version of SAXON doesn't return nodelist if source node
> >contain only one element?
> >
> >Thanks in advance,
> >Rakesh
> >
> >
> >
> >On Mon, 10 Dec 2007 Michael Kay wrote :
> > >There's no attachment. If you need to submit attachments it's best to do
>it
> > >using the support-requests tracker on SourceForge. However, if you can
>then
> > >it's better to try and cut the problem down to a few lines to make it
> >easier
> > >to see what's going on.
> > >
> > >There have been quite a few changes in the XPath APIs between Saxon 8.8
>and
> > >Saxon 9.0 in an attempt to improve conformance with the JAXP
>specifications
> > >while still supporting use of XPath 2.0 and non-DOM object models. You
> > >should find most of these changes described in the change logs for the
> > >various releases.
> > >
> > >Michael Kay
> > >http://www.saxonica.com/
> > >
> > >
> > >  _____
> > >
> > > From: saxon-help-bounces@lists.sourceforge.net
> > >[mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of Rakesh
> >guttal
> > >Sent: 10 December 2007 07:24
> > >To: saxon-help@lists.sourceforge.net
> > >Subject: [saxon] Difference Between SAXON 8.8 and 9.0.0.1
> > >
> > >
> > >
> > >
> > >Hi,
> > >
> > >I am using using J.D.K 1.4.2 and SAXON 8.8.
> > >
> > >I use XPATH, XSLT API's.
> > >
> > >Every thing was working fine with SAXON 8.8. But, when I tried to use
>SAXON
> > >9.0.0.1 it is not working correctly.
> > >
> > >Please find attached the XMLResultSet.java file where i am using XPATH,
> > >XSLT.
> > >
> > >Line number on which It is failing is 189.
> > >
> > >NodeList
>children=(NodeList)members.evaluate(node,XPathConstants.NODESET).
> > >
> > >It is not printing the System.out message after this line, when using
>SAXON
> > >9.0.0.1. But it works fine with SAXON 8.8.
> > >
> > >Please Provide any information regarding this.
> > >
> > >Thanks & Regards,
> > >Rakesh
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> ><http://adworks.rediff.com/cgi-bin/AdWorks/click.cgi/www.rediff.com/signatu
> >r
> >
> >e-home.htm/1050715198@Middle5/1961853_1954773/1961358/1?PARTNER=3&OAS_QUERY
> >=
> > >null target=new> Shaadi
> > >
> >
> >
> >
> >
> >
> ><http://adworks.rediff.com/cgi-bin/AdWorks/click.cgi/www.rediff.com/signatu
>r
> >e-home.htm/1050715198@Middle5/1961853_1954773/1961358/1?PARTNER=3&OAS_QUERY
>=
> >null target=new> Shaadi
> >
>
>
>
>