Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan 1288 posts 3921 karma points c-trib
    Oct 18, 2011 @ 17:07
    Dan
    0

    Add custom attribute with variable value to HTML tag in XSLT

    Hi,

    I'm integrating some 'addThis' buttons (http://www.addthis.com) to a macro.  The code which needs to be rendered includes this line:

    <div class="addthis_toolbox addthis_default_style " addthis:url="http://www.example.com">

    In the XSLT file, the value for 'http://www.example.com' needs to be a variable.

    The custom attribute 'addthis:url' seems to break the XSLT whichever way I try to render it.  I've tried loads of ways of rendering this, for example making the whole line render inside CDATA tags (in which case I can't pass in the variable - it just renders the variable name); and also adding <xsl:attribute name="addthis:url"> but this too doesn't work.  I can't seem to get around it.

    Can anyone point me in the right direction in being able to render this through XSLT?

    Thanks!

     

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Oct 18, 2011 @ 17:29
    Tom Fulton
    0

    Here is the answer from Chriztian, once you add this you should be able to use the normal <xsl:attribute> tag:  http://our.umbraco.org/forum/developers/xslt/23665-using-in-xslt-attribute

Please Sign in or register to post replies

Write your reply to:

Draft