XPath expression exception
        Posted  
        
            by fftoolbar
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by fftoolbar
        
        
        
        Published on 2009-10-26T14:34:43Z
        Indexed on 
            2010/05/25
            1:01 UTC
        
        
        Read the original article
        Hit count: 297
        
Hi I am not really sure if i am doing this right with XPath expression. I am trying to locate a text on DOM and this text is assingned to a variable. I have text stored in SQLite and i have retrievd the text and i am trying to locate it on the webpage which actually contains the text. so i ahve the following code:
var searchText = dataset[x]['selectedText'];
    	alert(dataset[x]['selectedText']);
    	var res = googbar_frames[0].contentDocument.evaluate("//*[.=searchText]",googbar_frames[0].contentDocument.body,null,XPathResult.ANY_TYPE,null);
    	alert(res.snapshotLength);
And i get the following error.
Error: Permission denied for <http://en.wikipedia.org> to call method XPathException.toString on <>.
Error: Permission denied for <http://en.wikipedia.org> to call method XPathException.toString on <>.
Have got the expression correct. I am trying to look for the text on DOM. Or am i going wrong somwehere? cheers
© Stack Overflow or respective owner