How to put XSLT element <xsl:value-of> inside an HTML tag?

M

Matt

How to put XSLT element <xsl:value-of> inside an HTML tag?

For example, how to represent hyperlink in XSL? I want to add hyperlink in XSL.
i.e. I need to generate <A HREF="http://mypage.html">home page</A> in HTML.

I tried the following approaches but still not work, it don't display anything

Approach #1: direct link, not work

A) double quote, <A HREF="<xsl:value-of select="/bio/homepage" />">home page</A>
OR
B) single quote, <A HREF='<xsl:value-of select="/bio/homepage" />'>home page</A>

Approach #2: introduce new variable, not work
<xsl:variable name="hp" select="/bio/homepage" />
<A HREF="$hp">my page</A>

Another example, if I do this, it don't display anything also.
<select name='<xsl:value-of select="@id"/>'>

any ideas? please advise. thanks!!
 
S

Silvio Bierman

Matt said:
How to put XSLT element <xsl:value-of> inside an HTML tag?

For example, how to represent hyperlink in XSL? I want to add hyperlink in XSL.
i.e. I need to generate <A HREF="http://mypage.html">home page</A> in HTML.

I tried the following approaches but still not work, it don't display anything

Approach #1: direct link, not work

A) double quote, <A HREF="<xsl:value-of select="/bio/homepage" />">home
page said:
OR
B) single quote, <A HREF='<xsl:value-of select="/bio/homepage" />'>home
page said:
Approach #2: introduce new variable, not work
<xsl:variable name="hp" select="/bio/homepage" />
<A HREF="$hp">my page</A>

Another example, if I do this, it don't display anything also.
<select name='<xsl:value-of select="@id"/>'>

any ideas? please advise. thanks!!

Use xsl:attribute for this. xsl:value-of is not allowed inside a tag.

Silvio Bierman
 

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

Forum statistics

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

Latest Threads

Top