When executing the below piece of code from Ch04\XPath\Cross-Browser\NameSpaceBooks.htm, the program return 0 at
if (oNodes.length > 0), thus preventing the code to execute. (I am not including the whole program).
p.s I am using the latest zxml.
js file
...... some code before
var sNameSpace = "xmlns:na='http://site1.com' xmlns:pub='http://site2.com'";
//Select the nodes
var oRoot = oXmlDom.documentElement;
var sXPath = "na:book/pub:name";
var oNodes = zXPath.selectNodes(oRoot, sXPath, sNameSpace);
if (oNodes.length > 0) {
alert(oNodes.length + " nodes selected with '" + sXPath + "'");
}
.....more code below
Armando