Hi,

I have an XML file:

<?xml version="1.0" encoding="utf-8"?>
<ads>
<ad title="test ad 1" descr="some short description 1" url="
http://google.com";></ad>
<ad title="test ad 2" descr="some short description 2" url="http://yahoo.com
"></ad>
<ad title="test ad 3" descr="some short description 3" url="http://msnbc.com
"></ad>
</ads>

When I use in PHP like this, attributes are printed correctly:

$adsFile = simplexml_load_file("ads.xml");
foreach($adsFile->ad as $item)
{
echo $item['title'];
}

However, when I try to display the attribute "title" with a PHPTAL template
like this:

<li tal:repeat="item ads"><a tal:attributes="href php:item['url']"
tal:content="php:item['title']"></a></li>

I get the following as the content of the anchor element: title="test ad 1".

Is this a bug?

Thanks

Roman
_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to