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
From stackoverflow
-
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)}"/>
Dimitre Novatchev : Why do you think that "Sign-up-Link" has a sibling named "guid"? The problem says: "I also have an element1234 being returned in the xml" ... Most vague description. Also, the concat() function is not really needed -- see my answer.Nick Allen - Tungle139 : Yes it's vague that's whay I said it depends where the guid elements appears in the xml, my assumption of sibling position is for illustration purposes -
<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...
Dimitre Novatchev : THis will not produce the required result. The problem says that the "guid" is an element somewhere in the xml document -- not an attribute of the parent of "Sign-up-Link" -
<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.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.