I have an XML parser which I've wrapped a $tpl->assign loop in
So the xml to struct parser is returning name value pairs in to two vars ( $key2, and $val )
I have a loop which returns the key and val and then does an assign for each name-vaue pair
while ( list ($key1) = each ($structure) ){
while ( list ($key2,$val) = each ($structure["$key1"]) ){
if ($key2 != "attributes"){
$tpl->assign($key2,$val);
}else{
// nothing for now
}
if ($key2 == "attributes"){ // recursive attribute search
while ( list ($key3,$attrVal) = each ($val) ){
//nothing for now
}
}
}
}
$key2 is not being returned. If I hard code var names, all is well, but the var $key2 is not being instanciated as a FastTemplate var.. What am I doing wrong here. ( or is there specific syntax I need to use to to make the var a literal.. I've tried wrapping it in quotes, and also wrapping it in escaped quotes )
The use case is bringing in xml data and merging it with a template.
Thanks for any help in advance!
Paul