XSLT: insert value inside of html-tag

A

Angus Parvis

Greetings,

have a look at this HTML code:

<td colspan="2"><input type="submit" value="Submit"/></td>

I want to support internationalization. To do so, i define variables,
that contain the text in the appropriate language.

This works:

<title><xsl:value-of select="$text.title"/></title>

so I tried this:

<td colspan="2"><input type="submit" value="<xsl:value-of
select="$text.submit"/>"/></td>

But this does not work. How can I make it work?

Thanks for your help,

Angus
 
M

Martin Honnen

Angus Parvis wrote:

have a look at this HTML code:

<td colspan="2"><input type="submit" value="Submit"/></td>

I want to support internationalization. To do so, i define variables,
that contain the text in the appropriate language.

This works:

<title><xsl:value-of select="$text.title"/></title>

so I tried this:

<td colspan="2"><input type="submit" value="<xsl:value-of
select="$text.submit"/>"/></td>

But this does not work. How can I make it work?

Read up on attribute value templates in an XSLT tutorial of your choice:
<input value="{concat($text, '.submit')}" ... />
In a result element like that <input> element you can construct an
attribute value by using an XPath expression in curly braces {}.
 
A

Angus Parvis

Martin said:
Read up on attribute value templates in an XSLT tutorial of your choice:
<input value="{concat($text, '.submit')}" ... />
In a result element like that <input> element you can construct an
attribute value by using an XPath expression in curly braces {}.

Thx :)

Angus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top