Login where USERNAME = in XML, so the HTML output is specif...">

Build href = using XSLT

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 who is 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 the value and use it as a CSS class, but how to use it for reference?

+4
source share
5 answers

What is wrong with using xsl: attribute?

 <a><xsl:attribute name='href' select='Username' />Login</a> 
+3
source

I think I could answer myself:

 <xsl:variable name="username" select="Username"/> <a href="{$username}">Login</a> 
+3
source

Same

 <a href="domain.com?={$user}">OMG!</a> 
+2
source

To notice that if you need an ampersand character as part of a URL to send multiple values, you can use "&"

 <a href="ESMData.aspx?dni={DNI}&amp;consulta=1">Ficha Técnica</a> 
0
source

xsl: attribute works:

 <a><xsl:attribute name='href'><xsl:value-of select='Username'/></xsl:attribute>Login</a> 
0
source

All Articles