OK thanks, I'll see if I can reproduce it.
 
Michael Kay
Saxonica Limited


From: Rakesh guttal [mailto:rak_mail2001@rediffmail.com]
Sent: 28 February 2008 17:10
To: Michael Kay
Cc: 'Mailing list for the SAXON XSLT and XQuery processor'
Subject: Re: RE: [saxon] Issue with XPATH evaluate


Hi Michael,

We have purchased saxon 9.0.0.1 (SA001) and we need your help to solve this issue.

1) I tried using saxon 9.0.0.1 and here also I face the same problem.

2) I also checked during execution of Test java file it's using saxon's xpath implementation.

3) xpath expression which i am using is "element[@name='option']";

Have attached IUFReportSchema.xsd with this mail, which is required for running this Test.java file.

Regards,
Rakesh
Software engineer
Infosys Technologies Ltd

On Wed, 27 Feb 2008 Michael Kay wrote :
>Firstly, 8.8 is rather an old version. Please try to reproduce the problem
>with a later version if you can.
>
>One possibility is that you are hitting a bug such as
>
>https://sourceforge.net/tracker/index.php?func=detail
><https://sourceforge.net/tracker/index.php?func=detail&aid=1616070&group_id=
>29872&atid=397617> &aid=1616070&group_id=29872&atid=397617
>
>Also, please check that you are actually loading Saxon as the XPath engine,
>by displaying the class name of the returned "factory" variable.
>
>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: 27 February 2008 18:15
>To: Michael Kay; saxon-help@lists.sourceforge.net
>Subject: [saxon] Issue with XPATH evaluate
>
>
>
>
>Hi Michael,
>
>I am using saxon 8.8 version of your saxon product.
>In order to improve the performance , i am using saxon's
>net.sf.saxon.xpath.XPathFactoryImpl for xpath querying.
>
>here goes Test java file.
>
>/////////////////////////////////////////////////////
>public class Test {
>        private XPathFactory      factory = null;
>      private XPath          xpath = null;
>
>      public static void main(String[] args) {
>
>
>System.setProperty("javax.xml.xpath.XPathFactory:"+XPathConstants.DOM_OBJECT
>_MODEL,"net.sf.saxon.xpath.XPathFactoryImpl");
>          XPathFactory      factory = null;
>          XPath          xpath = null;
>
>          String objectModel=XPathConstants.DOM_OBJECT_MODEL;
>          try {
>                factory      = XPathFactory.newInstance(objectModel);
>          } catch (XPathFactoryConfigurationException e1) {
>                e1.printStackTrace();
>          }
>
>          xpath          = factory.newXPath();
>          Document document = null;
>          try {
>              System.out.println("before documentbuild");
>            DocumentBuilderFactory dbf =
>DocumentBuilderFactory.newInstance();
>            DocumentBuilder db = dbf.newDocumentBuilder();
>            Test a = new Test();
>            InputStream is =
>a.getResourceAsInputStream("IUFReportSchema.xsd");
>            document = db.parse(is);
>            System.out.println("document:"+document);
>            is.close();
>
>            Node root = document.getDocumentElement();
>            NodeList elements = null;
>
>
>            String query = "element[@name='option']";
>            System.out.println("query="+query);
>
>            XPathExpression xpthQuery=xpath.compile(query);
>
>            elements = (NodeList)xpthQuery.evaluate( root,
>XPathConstants.NODESET);
>
>            System.out.println("elements size:"+elements.getLength());
>            //log.info("Resource file parsed " + filename);
>          }
>          catch (Exception e) {
>            // log.error("Problem parsing [" + filename + "]");
>            //log.error("Exception: "+e.getMessage());
>          }
>
>  public InputStream getResourceAsInputStream(String filename) {
>          return getClass().getClassLoader().getResourceAsStream  (filename);
>        }
>}
>////////////////////////////////////////////////////////
>
>when I run above java file with saxon8-xpath.jar on classpath,i get the
>below output (which is expected)
>
>elements size:1
>
>But, when I run this file with saxon8-xpath.jar & saxon8sa.jar, i get an
>unexpected output.
>
>elements size:0
>
>Why is that when i include saxon8sa.jar apart from saxon8-xpath.jar on
>classpath, it affects the xpath querying result? it's not able to find an
>element with name "option" and it returns nodelist of size 0.
>
>Regards,
>Rakesh
>
>
>
>
>
><http://adworks.rediff.com/cgi-bin/AdWorks/click.cgi/www.rediff.com/signatur
>e-home.htm/1050715198@Middle5/2047758_2040452/2047768/1?PARTNER=3&OAS_QUERY=
>null> Monster
>



Jeevan Sathi