Lets start from
This is the same as calling
But if you take a look at methods signature, you will see that it has two parameters.
public function addJs($name, $params = "")
That means that content of tags
<file helper="rewardssocial/purchase_share/getJs" />
will be passed as
$params values. Name of tags here means nothing.
Order is only important.
<file> tag has no content. But has
helper attribute, which tells that the result of helper method execution will be passed as first attribute value.
So as a result this xml is equal to.
Also you can specify parameters which can be passed to your helper
<arg>Now with arg!</arg>
<!-- more args here -->
This is equal to
Mage::helper('rewardssocial/purchase_share')->getJs('Now with arg!')