tags:

views:

364

answers:

3

I want to create this:

<a href="domain.com?=USERNAME">Login</a>

where USERNAME = in XML so the HTML output is specific to the user currently logged in. Can anyone advise?

I know I can use:

<xsl:variable name="class" select="a:Subject"/>
<p class="{$class}">English</p>

To extract a value and use it as a CSS Class but what about using it for a link?

+1  A: 

The same

<a href="domain.com?={$user}">OMG!</a>
Michael Krelin - hacker
A: 

Think I might have answered it myself:

<xsl:variable name="username" select="Username"/>
<a href="{$username}">Login</a>
danit
+1  A: 

What's wrong with using xsl:attribute?

<a><xsl:attribute name='href' select='Username' />Login</a>
Workshop Alex
To be nitpicky: The missing URL encoding is wrong. A decent URL-encoding function is missing in XSLT 1.0, when taking into account that creating HTML output was one of the design goals.
Tomalak