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 3945 posts 15163 karma points MVP 10x 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.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies