Hi Francesco,

The best place for asking XSL questions is the xsl-list
http://www.mulberrytech.com/xsl/xsl-list

> The problem is with link:
> <a href="&lt; xsl:value-of select='link'/&gt;">read the full article</a>

You can do that either by creating the attribute using the xsl:attribute instruction:
<a>
  <xsl:attribute name="href">
    <xsl:value-of select="link"/>
  </xsl:attribute>
  read the full article
</a>

or using an attribute-value-template (http://www.w3.org/TR/xslt#dt-attribute-value-template):

<a href="{link}">read the full article</a>

Hope that helps,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Francesco Pirani wrote:
 Hi...
i've a bit problem with xml...particularly with xslt...
i've to do a trasformation, from xml to html or xhtml. i want to take an xml element and put it as an attribut of a tag html. What i've to do? Let me explain better:

This is my xml document:

<?xml version="1.0"?>
<news>
<notizia>
<title>...</title>
<date>...</date>
<link>...</link>
<description>...</description>
</notizia>
...
...
...
</news>

This is the problem: this is the xslt...

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:template match="/">
<html>
<body>
<xsl:for-each select="news/notizia">

<p><b><font color="#FF0000">&l t;xsl:value-of select="title" /></font></b></p>
<p><xsl:value-of select="date" /></p>
<p><i><font color="#0000FF" ><xsl:value-of select="description" /></font></i></p>
<p><a href="< xsl:value-of select='link'/>">read the full article</a></p>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

The problem is with link:
<a href="&lt; xsl:value-of select='link'/&gt;">read the full article</a>
Using this, (eith entities &lt; and &gt;), the document links to localhost/<xsl:value-of select='link'/>, and it doesn't work...
but if i write
<a href="<xsl:value-of select='link'/>">read the full article</a>
using <, > and not entities, the trasformation doesn't work.
what i've to do?

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to