html tags within xsl:value-of

E

Edward

I am trying to send html tags via a variable into an XSL stylesheet. I
would like to put all of the HTML formatting into my variable and
minimize the work that needs to be done within the stylesheet.

My problem is that when I try to pass HTML formatting into an
<xsl:value-of> tag the < and > characters are transposed to < and >.

For example:

parameter inParam (set to "<b>Test</b>")

<xsl:value-of select="$inParam" />

browser output:

<b>Test</b>

not what I wanted (BOLD "Test").

When I view source I see:

<b>Test</b>

Any ideas?

Thanks.

Edward
 
E

Edward

Edward said:
I am trying to send html tags via a variable into an XSL stylesheet. I
would like to put all of the HTML formatting into my variable and
minimize the work that needs to be done within the stylesheet.

My problem is that when I try to pass HTML formatting into an
<xsl:value-of> tag the < and > characters are transposed to < and >.

For example:

parameter inParam (set to "<b>Test</b>")

<xsl:value-of select="$inParam" />

browser output:

<b>Test</b>

not what I wanted (BOLD "Test").

When I view source I see:

<b>Test</b>

Any ideas?

Thanks.

Edward

I go the solution on another forum:

<xsl:value-of
select="$inParam"
disable-output-escaping="yes" />

Edward
 
P

Peter Flynn

Edward said:
I am trying to send html tags via a variable into an XSL stylesheet. I
would like to put all of the HTML formatting into my variable and
minimize the work that needs to be done within the stylesheet.

My problem is that when I try to pass HTML formatting into an
<xsl:value-of> tag the < and > characters are transposed to < and >.

For example:

parameter inParam (set to "<b>Test</b>")

<xsl:value-of select="$inParam" />

browser output:

<b>Test</b>

not what I wanted (BOLD "Test").

When I view source I see:

<b>Test</b>

Any ideas?

See the FAQ: http://xml.silmaril.ie/authors/html/

///Peter
 

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,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top