p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional Ajax ISBN: 978-0-471-77778-6 (http://p2p.wrox.com/forumdisplay.php?f=244)
-   -   Question on NameSpaceBooks.htm (http://p2p.wrox.com/showthread.php?t=48082)

manahual September 20th, 2006 10:42 AM

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


All times are GMT -4. The time now is 05:41 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.