On Tue, 23 Nov 2004 12:23:01 +0100, "lievemario"
<li********@hotmail.com> wrote:
I have made a perl script witch gets information out of a database,
transfers it into an xml-file file and than I parse this to a html document
using xsl.
The problem is dat the html doc needs a parameter which can be found in the
xml file.
I've done something like
<xsl:variable name="id" select="person_id"/>
<a href="http://localhost/CGI/detailsselection.cgi?ID=$id"><xsl:value-of
select="name"></xsl:value-of><xsl:value-of
select="first_name"></xsl:value-of></a>
Of course this doesn't give me the value of the id-variable. But it just
returns $id.
How can I solve this?
This should work -- instead of putting the $id variable into the href
attribute directly in the <a> tag, make the href into an xsl:attribute,
and then you can do fancier processing of it in the contents of that xsl
element:
<a>
<xsl:attribute name="href">
<xsl:value-of
select="concat('http://localhost/CGI/detailsselection.cgi?ID=',$id)"/>
</xsl:attribute>
<xsl:value-of select="name"/> <xsl:value-of select="first_name"/>
</a>
(Note also that since your <xsl:value-of> elements selecting the name
and first name don't have any contents, I've normalized them into
self-closing tags, instead of having separate </xsl:value-of> closing
tags.
--
Morris M. Keesan --
ke****@alum.bu.edu