XSLT: insert value inside of html-tag

Discussion in 'XML' started by Angus Parvis, Aug 6, 2004.

  1. Angus Parvis

    Angus Parvis Guest

    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
     
    Angus Parvis, Aug 6, 2004
    #1
    1. Advertising

  2. 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 {}.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Aug 6, 2004
    #2
    1. Advertising

  3. Angus Parvis

    Angus Parvis Guest

    Martin Honnen wrote:
    >
    > 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
     
    Angus Parvis, Aug 6, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    1
    Views:
    946
    Silvio Bierman
    Oct 12, 2004
  2. RC
    Replies:
    2
    Views:
    455
    Malte
    May 10, 2005
  3. shruds
    Replies:
    1
    Views:
    933
    John C. Bollinger
    Jan 27, 2006
  4. Matt
    Replies:
    1
    Views:
    2,070
    Marrow
    Oct 12, 2004
  5. RC
    Replies:
    2
    Views:
    688
Loading...

Share This Page