View Single Post
  #1 (permalink)  
Old September 20th, 2006, 10:42 AM
manahual manahual is offline
Registered User
 
Join Date: Sep 2006
Location: Lake Worth, FL, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Question on NameSpaceBooks.htm

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
Reply With Quote