[webkit-dev] DOMXPathEvaluator

Igor Sales igor at kurumim.net
Sun May 25 18:27:31 PDT 2008

Hi everyone,

I apologize in advance if this is not the right place. I have been  
searching the web for answers, but cannot find them.

I have been trying to run an XPath query via DOMXPathEvaluator object  
in a cocoa App that uses WebKit.

The class wasn't available, but it is documented as a public API in  
the doxygen documentation, so I downloaded the sources to WebKit, and  
made the appropriate changes to expose XPathEvaluator and XPathResult  
so that they are accessible to my app. However, when trying to  
instantiate them, I get the error message:

2008-05-25 15:11:01.927 WKTest[55674:813] +[DOMXPathEvaluator init]:  
should never be used

after trying to run this method:

- (void)resolveXPathString:(NSString*)xpathString
	DOMDocument *doc = [_webView mainFrameDocument];
	DOMXPathEvaluator *eval = [[DOMXPathEvaluator new] autorelease];
	DOMXPathResult *res = [[DOMXPathResult new] autorelease];
	res = [eval evaluate:xpathString contextNode:doc resolver:nil  
type:DOM_ANY_TYPE inResult:res];


I am not trying to run XPath queries from JavaScript inside of the  
WebKit object, rather, I'd like to run a query from my app to find  
certain DOMNode objects.

Many thanks in advance for any help.

Best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.webkit.org/pipermail/webkit-dev/attachments/20080525/8bd80ee0/attachment.htm 

More information about the webkit-dev mailing list