Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
i am trying the following
<p class="mail">Mail: <a href="mailto:<xsl:value-of select="'current()/email'"/>"/></p>
but it gives me this error
System.Xml.XmlException: '<', hexadecimal value 0x3C, is an invalid attribute character. Line 42, position 25.
what syntax do i use to insert a value-of into the href?
Hi Jan,
The shortcut syntax for using a value inside another XML/HTML tag is like this...
<a href="mailto:{email}">
Cheers, Lee.
So i have to save the value in a variable first?
Because just adding curly brackets around the value-of statement doesn't work
<a href="mailto:{<xsl:value-of select="current()/email"/>}"/></p>
You could try...
<a href="mailto:{current()/email}">
... but without seeing the context of the rest of your XSLT, it's pure guesswork for me. :-)
Thanx for your replies.
This worked for me.
<p class="mail">Mail: <a> <xsl:attribute name="href"> <xsl:text>mailto:</xsl:text> <xsl:value-of select="current()/email"/> </xsl:attribute> <xsl:value-of select="current()/email"/> </a> </p>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
syntax help inserting value-of select into href
i am trying the following
<p class="mail">Mail:
<a href="mailto:<xsl:value-of select="'current()/email'"/>"/></p>
but it gives me this error
System.Xml.XmlException: '<', hexadecimal value 0x3C, is an invalid attribute character. Line 42, position 25.
what syntax do i use to insert a value-of into the href?
Hi Jan,
The shortcut syntax for using a value inside another XML/HTML tag is like this...
Cheers, Lee.
So i have to save the value in a variable first?
Because just adding curly brackets around the value-of statement doesn't work
<a href="mailto:{<xsl:value-of select="current()/email"/>}"/></p>
Hi Jan,
You could try...
... but without seeing the context of the rest of your XSLT, it's pure guesswork for me. :-)
Cheers, Lee.
Thanx for your replies.
This worked for me.
<p class="mail">Mail:
<a>
<xsl:attribute name="href">
<xsl:text>mailto:</xsl:text>
<xsl:value-of select="current()/email"/>
</xsl:attribute>
<xsl:value-of select="current()/email"/>
</a>
</p>
is working on a reply...