Go Back   Velocity Reviews > Newsgroups > XML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

XML - html tags within xsl:value-of

 
Thread Tools Search this Thread
Old 05-17-2006, 03:55 PM   #1
Default html tags within xsl:value-of


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



Edward
  Reply With Quote
Old 05-17-2006, 04:57 PM   #2
Edward
 
Posts: n/a
Default Re: html tags within xsl:value-of


Edward wrote:
> 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

  Reply With Quote
Old 05-17-2006, 10:11 PM   #3
Peter Flynn
 
Posts: n/a
Default Re: html tags within xsl:value-of

Edward wrote:
> 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
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump