Re: Help with XML error

From: Stuart Siegrist <ssiegrist@xxx.com>
Date: Tue Apr 02 2002 - 11:07:26 PST

If this is the exact snippet of your code, it looks like you have an
equals where there should be a plus. Try:

Element thisProduct = (Element)XPath.find("//product[@id='" +
codes.get(i) + "']", doc);

instead of:

> Element thisProduct = (Element)XPath.find("//product[@id='"+
> codes.get(i) = "']", doc);

Stuart

On Tue, 2002-04-02 at 10:20, Rowan wrote:
> I'm pulling my hair out on this one -- it was working perfectly, and
> suddenly it's giving me this error! I'm parsing an XML doc and finding a
> certain node based on values that the user has submitted. Here's the
> line of code that's triggering the error:
>
> Element thisProduct = (Element)XPath.find("//product[@id='"+
> codes.get(i) = "']", doc);
>
> It's part of a for loop where I'm looping through the array of responses
> (codes).
>
> And here's the error:
> java.lang.NullPointerException
> at com.caucho.xpath.Pattern.find(Pattern.java:86)
> at com.caucho.xpath.XPath.find(XPath.java:106)
> at _checkorder__jsp._jspService(/checkorder.jsp:52)
> at com.caucho.jsp.JavaPage.service(JavaPage.java:74)
> at com.caucho.jsp.Page.subservice(Page.java:485)
> at
> com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:181
> )
> at
> com.caucho.server.http.Invocation.service(Invocation.java:291)
> at
> com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:34
> 1)
> at
> com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java
> :271)
> at com.caucho.server.TcpConnection.run(TcpConnection.java:136)
> at java.lang.Thread.run(Thread.java:484)
>
> Any help is much appreciated.
>
> Thanks,
> Rowan
>
> _____________________________________________________________
> Get your Free, Permanent, and Private Email Today!
> ---------- www.email.ky -----------
>
> _____________________________________________________________
> Run a small business? Then you need professional email like
> you@xxx.com from Everyone.net http://www.everyone.net?tag
Received on Tue 02 Apr 2002 11:07:26 -0800

This archive was generated by hypermail 2.1.8 : Thu Sep 28 2006 - 20:17:00 PDT