The XPath implementation of XFactorStudio has this built in.
There you can do:
XPath.selectNodes(xml, //element); to get all nodes whereever that qualitfy.
Unfortunately, looks like the XFactorStudio domain is no longer..
I have placed the code I have (and we are still using) here:
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.
Unfortunately, Flash has never had a good means to traverse an
cant remember where i found this, but i use it quite a lot. Just drop the
xml root node in as your source node and it will return an array of all node
names that match your query string.
/*
** Function: findAllTag(source:XMLNode, key:String):Array
**
** Purpose: Recursively searches for,
If you start at the top of the tree everything that you want is below you.
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
function getNodes(xmlDoc, tagname, xmlObjArray, isFirst):Array{
if(xmlObjArray == null){
yourArr = new Array();
}else{
yourArr = xmlObjArray;
}
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:
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.
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
8 matches
Mail list logo