473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Hyperlink embedded in XSL

Hello,
Sorry fro the newbie question, but I can't seem to figure this one out.

I need to create a hyperlink from a series of "value-of selects" and build up the text with some static values to create a link similar to:

ftp://userid:password@ftp.myhost.com/dir1/dir2/MyFileName_PDF.indd_O_17936_20097.pdf

the "_0_" , "_" (between serises of numbers) & the ".pdf" are static text. The rest is picked up from a select query. I can generate the static text and output fine, but I can not figure out how to create a hyperlink that says "Click here to download your file" that links to the string of static text and xsl values.

Any ideas?



here is the XSL template being used to generate static text output:

Expand|Select|Wrap|Line Numbers
  1. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:output method="html" /><xsl:template match="/">
  2.  
  3. Dear <xsl:value-of select="//Sqls/CustomerName/Row/FirstName" /> <xsl:value-of select="//Sqls/CustomerName/Row/LastName" />,<br/><br/>
  4.  
  5. Thank you for your order. Your Files are ready to download.<br/><br/> 
  6.  
  7. ftp://userid:password@ftp.mycompany.com//Output/MyDocs/<xsl:value-of select="//Sqls/OrderProductList_ABC_ftp/Row/Name"/>_O_<xsl:value-of select="//Sqls/Order/Row/EncryptedOrderId"/>_<xsl:value-of select="//Sqls/OrderProductList_ABC_ftp/Row/OrderProductId"/>.pdf
  8.  
  9.  
  10.  
  11. </xsl:template>
  12. </xsl:stylesheet>
Thanks for any help you can lend!
May 1 '07 #1
3 2780
dorinbogdan
839 Expert 512MB
Welcome to TheScripts TSDN...

Since the result is HTML, you can use the anchor <a> tag to build the desired output, like this example:
[html]<a href='http://www.yahoo.com'>Any text here</a>[/html]
May 2 '07 #2
Thanks for the advice.

I can get the href to create a link if the text is static (http://www.yahoo.com), bu tif I need to insert dynamic text like (<xsl:value-of select="//Sqls/OrderProductList_ASN_ftp/Row/Name"/>) I can not ge the output to function. If I do not enclose the select in a hyperlink it works fine.

Any ideas???
May 3 '07 #3
dorinbogdan
839 Expert 512MB
Use a local variable to save the dynamic Url and then pass it to the href attribute.
Like this:
[html]<xsl:variable name='urlString' select="//Sqls/OrderProductList_ASN_ftp/Row/Name" />
<a href="$urlString">some text here</a>
[/html]

If the select query returns more than one nodes, I'm not sure if the variable can hold an array. If it doesn't, try to use a for-each loop to select one node at a time in the variable.
May 3 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ray | last post by:
I recently upgraded from Access 97 to Access 2003 and just enter some new data into table via an input form. The form has one hyperlink field to contain a file path. In Access 2003, it appears...
3
by: sloesch | last post by:
I am working with VS.net 2003, framework 1.1, developing with VB.net, and ASP.net, and I would like to know how you can create a dynamic hyperlink on the fly to a document stored in a SQL database?...
2
by: SAL | last post by:
I would like to create a VB.net function, that builds a dynamic hyperlink using System.Web.UI.WebControls.HyperLink, but I can not find any examples on how to generate a dynamic hyperlink. Has...
5
by: Dave | last post by:
I've been given a flash banner and told to make it a hyperlink. I tried this: <script type="text/javascript"> Document.getElementById("flashcontent").onclick = function(){...
1
by: chappy | last post by:
Greetings, I have a form where a user needs to select data from three different drop down menus. After those choices have been made, the result is displayed within a text box. The result...
1
by: bob8000 | last post by:
Hi everyone Could someone tell me how to solve the following problem within Visual Web Developer (ASP.NET and VB.NET) I have a datalist with an embedded repeater to display the item and it's...
20
by: tshad | last post by:
I had posted this problem earlier and just noticed that the Hyperlink is the problem. Apparently, it doesn't figure out the path correctly. It uses the path of the file it is in, even if it is...
1
by: LauraMc | last post by:
Hello, I'll be upfront - I'm not a programmer. I know bits and pieces of programming and can put together html pages fairly well. I have an .asp contact page that I inherited that needs to have a...
1
by: ikirschner | last post by:
I need to create a message using VBA in Outlook which contains a file reference. I would like to create a hyperlink on the file reference so that the reader can simply click the link. I am using...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.