[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Making Link in text

Subject: Making Link in text
From: Senthilukvelaan <skumaravelan@xxxxxxxxxxxxxx>
Date: Fri, 12 Sep 2008 00:41:32 -0700
 Making Link in text
Have a difficulty in producing the expected output.
Any pointer would help.
Input

<P>Please click <LINK>http://www.google.com</LINK>
<LINK_TEXT>
Google
</LINK_TEXT>
on the link below or copy and paste the address
onto your web browser's address window. Once you're on the web page, |
you will be instructed
</P>

xslt

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:template match="P">
<P>
    <xsl:call-template name="markup">
          <xsl:with-param name="content" select="." />
      <xsl:with-param name="link" select="//LINK" />
      <xsl:with-param name="text" select="//LINK_TEXT" />
    </xsl:call-template>
  </P>
</xsl:template>
</body>
</html>
</xsl:template>

<xsl:template match="P" name="markup"  >
  <xsl:param name="link" />
    <xsl:param name="text" />
  <a href="{$link}">
  <xsl:value-of select="$text" />
   </a>
</xsl:template>

</xsl:stylesheet>


Desired output.

<html>
<body>
<P>Please click
<a href="http://www.google.com">
Google
</a>
on the link below or copy and paste the address
onto your web browser's address window. Once you're on the web page, |
you will be instructed
</P>
</body>
</html>

Thanks,
S

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.