
walkProduct(node,output,rates);
else
{
var children,
i;
children = node.childNodes;
for(i = 0;i < children.length;i++)
walkNode(children.item(i),output,rates);
}
}
}
function walkProduct(node,output,rates)
{
if(node.nodeType == 1 && node.nodeName == “product”)
{
var price,
name,
children,
i;
children = node.childNodes;
for(i = 0;i < children.length;i++)
{
var child = children.item(i);
if(child.nodeType == 1)
{
if(child.nodeName == “price”)
price = walkPrice(child,rates);
else if(child.nodeName == “name”)
name = getText(child);
}
}
output.value += name + “: “ + price + “\r”;
}
}
function walkPrice(node,rates)
215
Attributes
continues