Question

I have some xml being returned in sharepoint, Im using xslt to create the hyperlink like so.

<a href="{substring-before(Sign-up-Link,',')}">
    Sign up for event
</a>

I also have an element <guid>1234</guid> being returned in the xml, an I'd like it so that the link will be with the guid appended as a querystring

e.g. http://www.foo.com/signup.aspx?guid=1234

how do i append the guid?

thanks

Was it helpful?

Solution

<a href="{substring-before(Sign-up-Link,',')}?guid={XPathExpression---Selecting---The---GUID}">
    Sign up for event
</a>

As the actual XML document is not shown, we cannot guess what XPath expression to use in order to select it.

Therefore, In the href attribute of the above literal result element, the second AVT (attribute-value-template) contains just a placeholder for this XPath expression.

OTHER TIPS

Depends where the guid appears in the xml but I would imagine concat() would do the trick e.g.

<a href="{concat(substring-before(Sign-up-Link,','),'?guid=',guid)}"/>
        <a>
            <xsl:attribute name="href">
                {substring-before(Sign-up-Link,',')}?guid=
                <xsl:value-of select="@guid">
                </xsl:value-of>
            </xsl:attribute>
            <xsl:attribute name="class">
                SignUpLink
            </xsl:attribute>
            Sign Up
        </a>

That might work...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top