Right. I missed that!  My eyes did an auto-correct... ;)

-----Original Message-----
From: Brian Minchau [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 14, 2006 8:57 AM
To: xalan-j-users@xml.apache.org
Cc: Robert Houben
Subject: RE: NullPointer in DOM2DTM.getLocalName

The line that Satoshi points out is:
   XPathAPI.eval( document, "/aaa/bbb/text)" ); <-- bad xpath
and it sure looks like the string is "/aaa/bbb/text)" not
"/aaa/bbb/text"
so it is probably that trailing ')' that is causing problems.


Perhaps there is no bug in Xalan-J, just a NPE rather than a good error
message and 2.7.0 has improved error reporting (lets keep our fingers
crossed).


- Brian



 

             "Robert Houben"

             <[EMAIL PROTECTED]

             sionware.net>
To 
                                       <xalan-j-users@xml.apache.org>

             11/14/2006 10:56
cc 
             AM                        "Robert Houben"

                                       <[EMAIL PROTECTED]>

 
Subject 
                                       RE: NullPointer in

                                       DOM2DTM.getLocalName

 

 

 

 

 

 





Actually, "/aaa/bbb/text" is not bad xpath, since there is nothing
preventing you from having an element called "text".  It just probably
doesn't return any nodes.

-----Original Message-----
From: Satoshi Iwayama [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 14, 2006 1:14 AM
To: Brian Minchau
Cc: xalan-j-users@xml.apache.org
Subject: Re: NullPointer in DOM2DTM.getLocalName

Brian,
Thank you so much.

The system released  3 years ago.
So, it's difficult to try 2.7.0 now.

I tried to make a testcase, but I didn't get the same exception.
   XPathAPI.eval( null, "/aaa/bbb/text()" );
   XPathAPI.eval( document, "/aaa/bbb/text)" ); <-- bad xpath
   XPathAPI.eval( document, "" );
   XPathAPI.eval( document, null );  etc...

If I get the same exception in our test environment, I'll report to
JIRA.

Regards,
Satoshi Iwayama


Brian Minchau wrote:
> Saoshi,
>
> Is there are reason you are using 2.5, which is now over three years
old?
> 2.5 - April 2003
> 2.5.1 - June 2003
> 2.5.2 - October 2003
>
> 2.6.0 - February 2004
>
> 2.7.0 - August 2005
>
> Xalan-J has moved on to 2.6 and 2.7 and a new release, 2.7.1 is
expected in
> this month.  It is very unlikely that we will be fixing any bugs in
2.5.
> Please try 2.7.0 if you can to see if the bug still exists.
>
> There is of course the possibility that a bug persists across the
releases,
> but there isn't enough information to go on from just your note.
Please
> provide a testcase in a JIRA issue so we can persue this.  Our issue
> tracking system (JIRA) is at:
> https://issues.apache.org/jira/secure/Dashboard.jspa and the project
is
> XalanJ2
>
> - Brian
>
>
>
>

>              Satoshi Iwayama

>              <[EMAIL PROTECTED]

>              land.com>
To
>                                        xalan-j-users@xml.apache.org

>              11/13/2006 06:30
cc
>              AM

>
Subject
>                                        NullPointer in
DOM2DTM.getLocalName
>

>

>

>

>

>

>
>
>
>
> I got following exception while doing XPathAPI.eval using xalan 2.5.0
in
> a production environment.
> I can't getting this exception again.
> Please let me know,
> why does it throw NullPointerException ?
> how can i fix this ?
>
> java.lang.NullPointerException
> at
>
org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.getLocalName(DOM2DTM.java(Compile
d
> Code))
> at org.apache.xpath.patterns.NodeTest.execute(NodeTest.java(Compiled
Code))
> at
>
org.apache.xpath.axes.PredicatedNodeTest.acceptNode(PredicatedNodeTest.j
ava(Compiled
>
> Code))
> at org.apache.xpath.axes.AxesWalker.nextNode(AxesWalker.java(Compiled
> Code))
> at
org.apache.xpath.axes.WalkingIterator.nextNode(WalkingIterator.java:192)
> at org.apache.xpath.axes.NodeSequence.nextNode(NodeSequence.java:281)
> at org.apache.xpath.axes.NodeSequence.item(NodeSequence.java:471)
> at org.apache.xpath.objects.XNodeSet.str(XNodeSet.java:272)
> at org.apache.xpath.objects.XObject.toString(XObject.java:306)
> at sample.util.XMLUtility.getData(XMLUtility.java:57)
>
> -------- Part of XMLUtility -----------------------------------------
>
> 55: public static String getData(Document document,String xpath) {
> 56: try {
> 57: return XPathAPI.eval(document, xpath).toString();
> 58: } catch (Exception e) {
> 59: e.printStackTrace();
> 60: }
> 61: }
> ------------------------------------------------------------------
>
> Regards,
> Satoshi Iwayama
>
>
>
>
>
>
>





Reply via email to