function getNodes(xmlDoc, tagname, xmlObjArray, isFirst):Array{

                if(xmlObjArray == null){
                        yourArr = new Array();
                }else{
                        yourArr = xmlObjArray;
                }
                
                if(xmlDoc.hasChildNodes()){

                        for(var i=0; i < xmlDoc.childNodes.length; i++){
                                if( (xmlDoc.childNodes[i].nodeType == 1) &&
                                        (xmlDoc.childNodes[i].nodeName == 
tagname)){
                                        
                                        //code here
                                                
                                        }
                                        
                                        yourArr.push(page);
                                        
                                }
                                getNodes(xmlDoc.childNodes[i], tagname, 
yourArr);
                        }
                }
                if (isFirst == true) {
                        //trace("finished!");
                        return yourArr;
                }

Does this help?
Andrew

On 26 Feb 2007, at 16:43, Tom Klepl wrote:

Thanks for the reply.. unfortunately this only returns matching nodes below the parent node specified. What I need is to crawl the XML tree and find ALL matching nodes, regardless of where they are in the tree.

Tom

Quoting [EMAIL PROTECTED]:

I believe:

XPathAPI.selectNodeList(node,"/*/nameOfNode");

will return an array of all child nodes with "nameOfNode" as their nodeName


On Feb 23, 2007, at 5:39 PM, Tom Klepl wrote:

Hi..

I am working on a project currently and I'm using Macromedia's XPathAPI. However, I need to recursively search one of my XML files which is 4 or 5 levels deep. The search I want to perform should return all nodes with a specified name, no matter where they are in the hierarchy.

Can anyone suggest/point me to a solution? I don't want to use xfactorstudio's API due to its size. I am thinking of extending XPathAPI.

Thanks.

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to