I've been able to publish binaries in an XSLT component template (CT) by referencing the TcmScriptAssistant namespace (xmlns:tcmse="http://www.tridion.com/ContentManager/5.1/TcmScriptAssistant") and using the following:
<h2>PublishBinary()</h2>
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="tcmse:PublishBinary(string(./@xlink:href))" />
</xsl:attribute>
<xsl:value-of select="./@xlink:title" />
</xsl:element>
I recently tried AddBinary:
<h2>AddBinary() with webdav</h2>
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="tcmse:AddBinary(string(./@xlink:href), '/webdav/040 CreateandBreak/Root/Media/Image', 'some_variant')" />
</xsl:attribute>
<xsl:value-of select="./@xlink:title" />
</xsl:element>
The resulting markup for both:
<h2>PublishBinary()</h2>
<a href="/Media/buddy_tcm7-274.jpg">buddy</a>
<h2>AddBinary() with webdav</h2>
<a href="/Media/Image/buddy.jpg">buddy</a>
I can see addBinary used a different folder (structure group) as provided in the second parameter.
Did I enter the third parameter for String variantID wrong? I'm not sure if I should see its text in the .jpg name.
Any other difference between PublishBinary and AddBinary, especially when using XSLT CTs?
I'm trying to understand if one should be used over the other.
For clarification, I believe this is the Tridion Object Model AddBinary under the TCMScriptAssistant class (not TOM.NET). I'm sure XSLT CTs will remain supported, but I'll follow up with a different question on better ways to handle binaries, possibly in modular templates.
Other info: - Tridion 2011 SP1 Schema has links to multimedia Component embedded on page with XSLT CT to make "static" component presentations