Pascal, I don't know which README you refer to. It is possible that it is out-of-date. If you read the FAQ, you will see that for XMLBeans 2.3, to work with Saxon (8.8 is supported), you need saxon8.jar and saxon8-dom.jar, along with xbean_xpath.jar and the other jars in the XMLBeans distribution. This already applies to XMLBeans 2.2 and the version of Saxon (8.6.1) supported by it. This information appears on the XMLBeans home page too. - Wing Yew
________________________________ From: Pascal Maugeri [mailto:[EMAIL PROTECTED] Sent: Thursday, February 14, 2008 2:58 AM To: user@xmlbeans.apache.org Subject: Re: How to apply an xpath query to a document ? Hi Jacob Is this from the plain XPath/Xquery sample? If so I'm not getting the same issue, which makes me wonder if its something in your environment. well I don't know. Actually I've followed the README: 1. Set XMLBEANS_HOME in your environment 2. Ant must be on your PATH 3. xbean_xpath.jar and saxon8.jar must be on your class path. These files are created in the build/lib directory when you build XMLBeans from source. 4. To compile the schemas and sample source, run "ant build" 5. To execute the sample, run "ant run" and the "ant run" gives me the error. Should I set any other thing in my environment ? I've downloaded xmlbeans-2.3.0 but not compiled from source. I have saxon8.jar and xbean_xpath.jar in my classpath, etc. Regards, Pascal If not, what is the code thats causing this (query, xsd, java, etc.) Thanks, -jacobd On Feb 13, 2008 8:10 AM, Pascal Maugeri <[EMAIL PROTECTED]> wrote: > Jacob > > I get the following error when I try to run the sample: > > [echo] ============================== running XQueryXPath > [java] Running ExecQuery.selectEmpsByStateCursor > [java] > [java] Exception in thread "main" java.lang.NullPointerException > [java] at > net.sf.saxon.query.StaticQueryContext.buildDocument(StaticQueryContext.j ava:412) > [java] at > org.apache.xmlbeans.impl.xquery.saxon.XBeansXQuery.execQuery(XBeansXQuer y.java:79) > [java] at > org.apache.xmlbeans.impl.store.Query$SaxonQueryImpl$SaxonQueryEngine.cur sorExecute(Query.java:345) > [java] at > org.apache.xmlbeans.impl.store.Query$SaxonQueryImpl.cursorExecute(Query. java:243) > [java] at > org.apache.xmlbeans.impl.store.Query.cursorExecQuery(Query.java:48) > [java] at > org.apache.xmlbeans.impl.store.Cursor._execQuery(Cursor.java:1336) > [java] at > org.apache.xmlbeans.impl.store.Cursor._execQuery(Cursor.java:1331) > [java] at > org.apache.xmlbeans.impl.store.Cursor.execQuery(Cursor.java:3839) > [java] at > org.apache.xmlbeans.samples.xquery.ExecQuery.updateWorkPhone(ExecQuery.j ava:74) > [java] at > org.apache.xmlbeans.samples.xquery.XQueryXPath.executeQueries(XQueryXPat h.java:75) > [java] at > org.apache.xmlbeans.samples.xquery.XQueryXPath.main(XQueryXPath.java:54) > [java] Java Result: 1 > > I followed the instructions in the README (setting environment variables, > etc.). > > Do you have any idea of what could be my problem ? > > Thanks for your help > Pascal > > > > > > > > > On Feb 10, 2008 8:27 PM, Jacob Danner <[EMAIL PROTECTED]> wrote: > > > > > > > > Take a peek at > > http://xmlbeans.apache.org/samples/XQueryXPath.html > > > > -jacobd > > > > > > > > > > On Feb 10, 2008 7:56 AM, Pascal Maugeri <[EMAIL PROTECTED]> wrote: > > > Hi > > > > > > I need to do this simple operation: having a XML document (as a String > for > > > instance) I want to apply to it an XPath query and to get the XML > fragment > > > result in a new String. > > > > > > Could you give me some source code sample or a link ? > > > > > > Thanks in advance > > > Pascal > > > > > > > > > > > -- > > I'm competing in a Half-Ironman distance triathlon to raise money for > > the fight against cancer! > > Please help support my efforts by going to: > > http://www.active.com/donate/tntwaak/jacobd > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.