CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2004
    Posts
    8

    xsl template parameter passing

    I was wondering if anyone has done something similar to what I need done.

    I have to show users an error whenever something goes wrong. I have a template such as this:

    <xsl:template name="errorbox">
    <xsl:param name="message" select="''" />
    <div class="errorbox">
    <h2><xsl:value-of select="$lang.NBoxError"/>:<xsl:text> </xsl:text></h2>
    <div class="boxcontent">
    <xsl:value-of select="$message"/>
    </div>
    </div>
    </xsl:template>

    this works fine if "$message" is only text. however, many times, a link needs to be included in the "message" portion. so i dont know how to call a template, and pass in the "body" of the message, which can contain html. and use xsl to generate that html. I've tried something like this, but does not work:

    <xsl:call-template name="errorbox" >
    <xsl:with-param name="message" >
    <a>
    <xsl:attribute name="href">URLTEXT</xsl:attribute>
    Link
    </a>
    </xsl:with-param>
    </xsl:call-template>

    please help.

  2. #2
    Join Date
    Oct 2004
    Posts
    107

    Re: xsl template parameter passing

    sounds like? <xsl:copy-of select="$message"/>

  3. #3
    Join Date
    Dec 2004
    Posts
    8

    Re: xsl template parameter passing

    thank you. that was it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured