Fixed XPath query on inner root

Coordinator
Jun 26, 2011 at 9:14 AM

I understand because the query wich starts on a inner node doesn't work.

We wrote the query always with an absolute path (ex "/query xpath") and this is the error.

We have to use a relative path for evaluate these queries (ex: "./query xpath").

Now in this way the code works:

var div = fw.selectElements(fw.document, '/root/div')[0];
system.stdout("Test SELECT_ELEMENTS /root/div[0] :" + div + "\n");
var search = fw.selectElements(div, './div'); //funziona partendo da un nodo diverso dal document purché il path inizi con "./"!!!
for (var s in search) {
	system.stdout("Test SELECT_ELEMENTS /root/div->/div :" + search[s] + "\n");
}

Coordinator
Jun 26, 2011 at 10:50 AM

Ok, well done. Now remain the other problem on xpath: the crash that occurs when xpath evaluating forks in multiple branchs (when it make a union of results). I think it depends by "compareDocumentPosition" function.