RESOLVED DUPLICATE of bug 6638 5576
XPath query fails with "is not object"
https://bugs.webkit.org/show_bug.cgi?id=5576
Summary XPath query fails with "is not object"
Michiel Roding
Reported 2005-10-31 12:30:31 PST
I've been trying to use XPath in both the nightly Safari and the stable release; and it just won't work; any clearity on how to use, if usable, XPath in Webkit would be appreciated. A sample document; which works in Firefox and Camino; <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>Safari XPath test</title> <style> .bla { border: 1px solid red;} </style> </head> <body> <dl> <dt>lorem</dt> <dd>ipsum</dd> <dd>another one</dd> <dt>next</dt> <dd>follow-up</dd> </dl> <script> var iterator = document.evaluate("/html/body", document, null, 0, null); while(item = iterator.iterateNext()) { item.className = 'bla'; } </script> </body> </html> No matter what XPath query I used (I was trying //dl/dt[1]/following-sibling::dd[1]) - always get the error: TypeError: value undefined (result of expression document.evaluate) is not object.
Attachments
Paul Everitt
Comment 1 2005-12-02 06:45:05 PST
I asked in IRC and found out that XPath evaluation isn't claimed to work. IIRC, it also isn't on the near-term radar either. That's too bad, as I could really use this facility.
Joost de Valk (AlthA)
Comment 2 2005-12-27 01:28:03 PST
Confirmed on request of Paul Everitt.
Eric Seidel (no email)
Comment 3 2005-12-27 01:58:52 PST
Folks on the KDE side, in the library KDOM (which stems from a very similar code base to WebCore) already have two working xpath implementations. One for 1.0 and a partial one for 2.0. It's possible that someone could port one of these into WebCore with relatively minimal effort.
Jesse Costello-Good
Comment 4 2006-01-17 20:36:09 PST
I am evaluating Safari for a port of TIBCO(R) General Interface, a mature AJAX platform that is currently IE only. Fixing this bug would make the port more feasible.
Anders Carlsson
Comment 5 2006-05-08 14:28:32 PDT
*** This bug has been marked as a duplicate of 6638 ***
Note You need to log in before you can comment on or make changes to this bug.