By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,784 Members | 1,248 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,784 IT Pros & Developers. It's quick & easy.

HTML Tags in XMT/XSLT

P: n/a
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!
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
ted
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" <ws******@yahoo.com> wrote in message
news:25**************************@posting.google.c om...
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!

Jul 20 '05 #2

P: n/a
In article <25**************************@posting.google.com >,
Spence Hackney <ws******@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
pt**@interlog.com
Jul 20 '05 #3

P: n/a
Thanks! This works like a charm!!!

Spence

pt**@interlog.com (Patrick TJ McPhee) wrote in message news:<bj**********@news.eusc.inter.net>...
In article <25**************************@posting.google.com >,
Spence Hackney <ws******@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"/>

Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.