From:  Matthieu Corageoud <matthieu.corageoud@free.fr>
Date:  24 Mar 2009 07:05:18 Hong Kong Time
Newsgroup:  news.mozilla.org/mozilla.dev.web-development
Subject:  

XPath evaluation after XSL transformation

NNTP-Posting-Host:  88.183.113.86

Hello everybody,

I have a problem while using XPath evaluation after XSL transformation.

Here is the description of what I am trying to do :

- I retrieve a XML file with an XHR request.

- Then I transformed the result using a XSL file and append it to the 
document with following lines :
var fragment = processor.transformToFragment(xhrxml.responseXML, document);
document.getElementById('results').appendChild(fragment);

- Then I would like to record some events on nodes which have just been 
added.
document.evaluate('//xhtml:tbody//xhtml:a', document, resolver, 
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);

My resolver function is :
function resolver(prefix) {
	return 'http://www.w3.org/1999/xhtml';
}

But the above line does not return any node, whereas it works without 
problem on Safari or Chrome.

It seems that nodes which have been added to the document after 
transformation do not have the good namespace. If I remove prefix in 
query :
document.evaluate('//tbody//a', document, resolver, 
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
It works under firefox but no more in Safari or Chrome.



Here is a sample of my XML file :

	
	


And my XSL file has following header :





What do I wrong ? Is it a bug ? Thank you by advance for any idea.

Mat.