adding html hyperlink with XSLT transform module

Post Reply
ehollander
Newbie
Posts: 1
Joined: Sat May 28, 2022 3:54 am

adding html hyperlink with XSLT transform module

Post by ehollander »

Hi!

I'm running a very simple XML file that contains a dropbox link through the XSLT transform module to create HTML that that will be part of the body of an html email message.

I can transform the xml into html that displays the full link as text that is not clickable in the email message, but I can't figure out how to edit my xstl transform file to transform the text of the link object into a clickable hyperlink.

Here is my flow:
Screen Shot 2022-05-31 at 9.54.48 AM.png
Screen Shot 2022-05-31 at 9.54.48 AM.png (118.43 KiB) Viewed 5549 times
Here is a sample of my xml I will receive (this comes from the DropboxGS Switch App Store app) :

Code: Select all

<?xml version="1.0"?>
<?xml-stylesheet href="dropboxlink.xsl" type="text/xsl" ?>
<root>
  <filename>FFW-2216.pdf</filename>
  <url>https://www.dropbox.com/s/x8rzm7g71knn1bj/FFW-2216.pdf?dl=0</url>
  <filepath>/MagazineIssues/First/FFW-2216.pdf</filepath>
</root>
This is the line in my xslt file that I can't figure out how to code to be a clickable hyperlink:

Code: Select all

<div><xsl:value-of select="root/url"/></div>
This is my complete xslt transform file code:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
  <html>
  <body>


<div>Digital Replica file for <xsl:value-of select="root/filename"/> is available for download at the following link:</div>
<div><xsl:value-of select="root/url"/></div>


<br> </br>
<div>Please do not share this file.</div>
<div>After downloaded, place the pdf on your share drive as this link will expire.</div>

<br> </br>
<br> </br>
<div>Please contact AAune@a360media.com or GDeSantis@a360media.com if you have any issues downloading this file.</div>
<br> </br>
<br> </br>
Thank You.
 
<br> </br>
<br> </br>
<br> </br>
<br> </br>


  </body>
  </html>
</xsl:template>

</xsl:stylesheet>
Any suggestion on how I can adjust my xslt transform code so the link text can be display as a clickable link in my html email?

Thanks for any assistance!

Eric
User avatar
JimmyHartington
Advanced member
Posts: 298
Joined: Tue Mar 22, 2011 7:38 am

Re: adding html hyperlink with XSLT transform module

Post by JimmyHartington »

Hi Eric

Could this do it?

Code: Select all

<div><a href='<xsl:value-of select="root/url"/>'>Download link</a></div>
Post Reply