xsl-list
[Top] [All Lists]

Re: Building Dynamic Urls

2005-05-07 01:21:42

You need to move the logic inside the variable, something like below:

<xsl:variable name="newURL">
    <xsl:value-of select="$url"/>
    <xsl:if test="child::area">
        <xsl:text>?area=</xsl:text>
        <xsl:value-of select="area"/>
    </xsl:if>
    <xsl:if test="child::action">
        <xsl:text>?action=</xsl:text>
        <xsl:value-of select="action"/>
    </xsl:if>
    <xsl:if test="child::page">
        <xsl:text>?page=</xsl:text>
        <xsl:value-of select="page"/>
    </xsl:if>
</xsl:variable>
<xsl:value-of select="$newURL"/>


And in this case one would use <xsl:choose> rather than <xsl:if>

Regards,

--A

_________________________________________________________________
Don?t just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>