Copied to clipboard

Flag this post as spam?

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


  • BaconBeastNz 40 posts 60 karma points
    Apr 04, 2011 @ 08:58
    BaconBeastNz
    0

    How to send variable through to Macro XSL from usercontrol?

    Hi there

    I've created a custom section inside Umbraco and I want to pass some XML through to an XSLT file for styling, to do this I'm calling a Macro and want to pass the XML in as a parameter, but as its a Server side variable, not sure how to send it through?

    E.G <umbraco:Macro Alias="MyMacro" Info="<%=XML%>" runat="server" />

    Any help appreciated!

    Thanks

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Apr 04, 2011 @ 16:44
    Lee Kelleher
    0

    Hi BaconBestNz, (what a name!)

    Firstly, I've never tried to dynamically load in XML directly into a macro via a property field ... and even if it did work, it would parse it as a string value (not an XmlDocument).

    My advice would be to store the XmlDocument (or rather an XPathNodeIterator) in a HTTP item... which you can then retrieve within the XSLT using the following method:

    <xsl:variable name="InfoXml" select="umbraco.library:GetHttpItem('InfoXml')" />

    Cheers, Lee.

Please Sign in or register to post replies

Write your reply to:

Draft