Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 07:09 AM
Spence Hackney
Guest
 
Posts: n/a
Default HTML Tags in XMT/XSLT

I am using ASP.NET to get XML data from a database, style it with an
XSLT, and then display it as HTML to a browser. The content in the
database, which becomes my XML, has HTML tags embedded in it. When
putting the data from the database into an XML stream, the ASP.NET
class automatically escapes all my HTML tags for me so that it will be
valid XML.

Here is my problem...after my XSLT transforms the XML into HTML my
embedded HTML tags are still escaped, thus they are displayed to the
browser.

I can think of a couple ways to do this, all too complex and slow to
be the best way. Can anyone offer a good strategy for this? This
must be something folks do all the time!
  #2  
Old July 20th, 2005, 07:09 AM
ted
Guest
 
Posts: n/a
Default Re: HTML Tags in XMT/XSLT

I have the same problem and I've yet to come across a good solution (BTW I'm
using Java, not .NET.)

What I'm doing now is using Perl to get the XML into the database (not
parsing the XML, just grabbing it as plain text).


"Spence Hackney" <wshackne@yahoo.com> wrote in message
news:25c7dc07.0309102019.58ab2602@posting.google.c om...[color=blue]
> I am using ASP.NET to get XML data from a database, style it with an
> XSLT, and then display it as HTML to a browser. The content in the
> database, which becomes my XML, has HTML tags embedded in it. When
> putting the data from the database into an XML stream, the ASP.NET
> class automatically escapes all my HTML tags for me so that it will be
> valid XML.
>
> Here is my problem...after my XSLT transforms the XML into HTML my
> embedded HTML tags are still escaped, thus they are displayed to the
> browser.
>
> I can think of a couple ways to do this, all too complex and slow to
> be the best way. Can anyone offer a good strategy for this? This
> must be something folks do all the time![/color]


  #3  
Old July 20th, 2005, 07:10 AM
Patrick TJ McPhee
Guest
 
Posts: n/a
Default Re: HTML Tags in XMT/XSLT

In article <25c7dc07.0309102019.58ab2602@posting.google.com >,
Spence Hackney <wshackne@yahoo.com> wrote:

% I am using ASP.NET to get XML data from a database, style it with an
% XSLT, and then display it as HTML to a browser. The content in the
% database, which becomes my XML, has HTML tags embedded in it. When
% putting the data from the database into an XML stream, the ASP.NET
% class automatically escapes all my HTML tags for me so that it will be
% valid XML.
%
% Here is my problem...after my XSLT transforms the XML into HTML my
% embedded HTML tags are still escaped, thus they are displayed to the
% browser.

Assuming you're using xsl:value-of to write out the html data, try

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

Patrick TJ McPhee
East York Canada
ptjm@interlog.com
  #4  
Old July 20th, 2005, 07:10 AM
Spence Hackney
Guest
 
Posts: n/a
Default Re: HTML Tags in XMT/XSLT

Thanks! This works like a charm!!!

Spence

ptjm@interlog.com (Patrick TJ McPhee) wrote in message news:<bjq1lh$ju1$1@news.eusc.inter.net>...[color=blue]
> In article <25c7dc07.0309102019.58ab2602@posting.google.com >,
> Spence Hackney <wshackne@yahoo.com> wrote:
>
> % I am using ASP.NET to get XML data from a database, style it with an
> % XSLT, and then display it as HTML to a browser. The content in the
> % database, which becomes my XML, has HTML tags embedded in it. When
> % putting the data from the database into an XML stream, the ASP.NET
> % class automatically escapes all my HTML tags for me so that it will be
> % valid XML.
> %
> % Here is my problem...after my XSLT transforms the XML into HTML my
> % embedded HTML tags are still escaped, thus they are displayed to the
> % browser.
>
> Assuming you're using xsl:value-of to write out the html data, try
>
> <xsl:value-of select="whatever" disable-output-escaping="yes"/>[/color]
 

Bookmarks

Thread Tools

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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles