http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2589 *** shadow/2589 Thu Jul 12 00:43:17 2001 --- shadow/2589.tmp.17709 Thu Jul 12 00:43:18 2001 *************** *** 0 **** --- 1,60 ---- + +============================================================================+ + | XPath Query: Inconsistent results with and without namespace prefix | + +----------------------------------------------------------------------------+ + | Bug #: 2589 Product: XalanJ2 | + | Status: NEW Version: 2.2.x | + | Resolution: Platform: PC | + | Severity: Major OS/Version: Windows NT/2K | + | Priority: Other Component: org.apache.xpath | + +----------------------------------------------------------------------------+ + | Assigned To: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + | CC list: Cc: | + +----------------------------------------------------------------------------+ + | URL: | + +============================================================================+ + | DESCRIPTION | + XPath query with namespace returns no results whereas it returns the correct + results with a similar query without namespaces. The bug appears in both 2.1.0 + and 2.2.D6 distributions. + + This is my Folder.xml: + + <?xml version="1.0"?> + <folders xmlns:xlink="http://www.w3.org/1999/xlink"> + <folder name="child1" path="/child1"> + <parent test="root" xlink:href="/" xlink:title="/"/> + </folder> + <folder name="child2" path="/child2"> + <parent test="root" xlink:href="/" xlink:title="/"/> + </folder> + <folder name="child21" path="/child21"> + <parent test="non-root" xlink:href="/child2" + xlink:title="/child2"/> + </folder> + </folders> + + This is my command-line and results without namespaces (CORRECT). + + D:\apache.org\xalan-j_2_2_D6\bin>java -cp xalan.jar;xalansamples.jar ApplyXPath + D:/Temp/Folder.xml "/folders/folder[./parent/@test = 'root']" + Loading classes, parsing D:/Temp/Folder.xml, and setting up serializer + Querying DOM using /folders/folder[./parent/@test = 'root'] + <output> + <folder name="child1" path="/child1"> + <parent test="root" xlink:href="/" xlink:title="/"/> + </folder> + <folder name="child2" path="/child2"> + <parent test="root" xlink:href="/" xlink:title="/"/> + </folder> + </output> + + This is my command-line and results WITH namespaces (INCORRECT). Results are + expected to be the same as above. + + D:\apache.org\xalan-j_2_2_D6\bin>java -cp xalan.jar;xalansamples.jar ApplyXPath + D:/Temp/Folder.xml "/folders/folder[./parent/@xlink:href = '/']" + Loading classes, parsing D:/Temp/Folder.xml, and setting up serializer + Querying DOM using /folders/folder[./parent/@xlink:href = '/'] + <output> + </output>
