xsl-list
[Top] [All Lists]

[xsl] Making Link in text

2008-09-12 03:41:58
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>